Download .zip |
Info | Example | View files (208) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-09-26 (1 year ago) | Not enough user ratings | Total: 84 | All time: 9,207 This week: 440 |
Version | License | PHP version | Categories | |||
php-configuration-lo 1.0.0 | Custom (specified... | 5 | PHP 5, Files and Folders, Configuration |
Description | Author | ||||||||
This class can load configuration from YAML files into arrays. |
|
The PHP configuration loader class helps the management and loading of application configuration through arrays or Yaml configuration files.
Via Composer:
composer require am/config
Or simply download the code and add to your project.
config.yaml
root_path: C:/xampp/htdocs
base_url: /
directories:
controllers: controllers
models: models
views: views
core: core
test_number: 10
config-2.yaml
this name: config 2
this number: 10
test_number: 10
<?php
require dirname(__DIR__) . '/vendor/autoload.php';
$config_mixed_src = array(
dirname(__DIR__) . '/examples/configs/config.yaml',
dirname(__DIR__) . '/examples/configs/config-2.yaml',
array(
'hotel'=>'5 star',
'rooms'=> 10
)
);
$config = new \Am\Config\Config($config_mixed_src,1,true);
var_dump($config);
Resulting dump:
<?php
object(Am\Config\Config)[2]
public 'config' =>
array (size=3)
0 => string 'C:\xampp\htdocs\projects\composer\config/examples/configs/config.yaml' (length=69)
1 => string 'C:\xampp\htdocs\projects\composer\config/examples/configs/config-2.yaml' (length=71)
2 =>
array (size=2)
'hotel' => string '5 star' (length=6)
'rooms' => int 10
public 'src' => int 1
public 'debug' => boolean true
public 'root_path' => string 'C:/xampp/htdocs' (length=15)
public 'base_url' => string '/' (length=1)
public 'directories' =>
array (size=4)
'controllers' => string 'controllers' (length=11)
'models' => string 'models' (length=6)
'views' => string 'views' (length=5)
'core' => string 'core' (length=4)
public 'test_number' => int 10
public 'this_name' => string 'config 2' (length=8)
public 'this_number' => int 10
public 'hotel' => string '5 star' (length=6)
public 'rooms' => int 10
You can now retrieve application configuration within your file as public vars as follows:
echo $config->hotel; //returns "5 star"
foreach($config->directories as $dir){
echo $dir;
}
To allow PHP to parse YAML files, you will require php libyaml available.
https://github.com/LegendOfMCPE/LoM-CMS/wiki/How-to-Install-LibYAML
https://stackoverflow.com/questions/27122701/installing-php-yaml-extension-with-xampp-on-windows
Note for Windows Xampp users, it is useful to copy yaml.dll to your xampp php folder as well to allow it to run in CLI (important mainly while running tests).
Files |
File | Role | Description | ||
---|---|---|---|---|
docs (1 directory) | ||||
examples (1 file, 1 directory) | ||||
src (1 file) | ||||
tests (1 file, 1 directory) | ||||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
phpdoc.dist.xml | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
readme.md | Doc. | Documentation |
Files | / | docs | / | api |
File | Role | Description | ||
---|---|---|---|---|
classes (1 file) | ||||
css (10 files, 1 directory) | ||||
files (2 files) | ||||
font (1 file) | ||||
graphs (1 file) | ||||
images (12 files, 1 directory) | ||||
img (7 files, 2 directories) | ||||
js (25 files, 3 directories) | ||||
namespaces (3 files) | ||||
packages (3 files) | ||||
reports (3 files) | ||||
.htaccess | Data | Auxiliary data | ||
checkstyle.xml | Data | Auxiliary data | ||
deprecated.html | Doc. | Documentation | ||
errors.html | Doc. | Documentation | ||
graph_class.html | Doc. | Documentation | ||
index.html | Doc. | Documentation | ||
markers.html | Doc. | Documentation |
Files | / | docs | / | api | / | css |
File | Role | Description | ||
---|---|---|---|---|
phpdocumentor-clean-icons (2 files, 1 directory) | ||||
bootstrap-combined.no-icons.min.css | Data | Auxiliary data | ||
bootstrap-responsive.css | Data | Auxiliary data | ||
bootstrap-responsive.min.css | Data | Auxiliary data | ||
bootstrap.css | Data | Auxiliary data | ||
bootstrap.min.css | Data | Auxiliary data | ||
font-awesome.min.css | Data | Auxiliary data | ||
jquery.iviewer.css | Data | Auxiliary data | ||
prettify.css | Data | Auxiliary data | ||
prism.css | Data | Auxiliary data | ||
template.css | Data | Auxiliary data |
Files | / | docs | / | api | / | css | / | phpdocumentor-clean-icons |
File | Role | Description | ||
---|---|---|---|---|
fonts (2 files) | ||||
lte-ie7.js | Data | Auxiliary data | ||
style.css | Data | Auxiliary data |
Files | / | docs | / | api | / | css | / | phpdocumentor-clean-icons | / | fonts |
File | Role | Description |
---|---|---|
phpdocumentor-clean-icons.dev.svg | Data | Auxiliary data |
phpdocumentor-clean-icons.svg | Data | Auxiliary data |
Files | / | docs | / | api | / | files |
File | Role | Description |
---|---|---|
Config.html | Doc. | Documentation |
Config.php.txt | Doc. | Documentation |
Files | / | docs | / | api | / | images |
File | Role | Description | ||
---|---|---|---|---|
iviewer (8 files) | ||||
apple-touch-icon-114x114.png | Icon | Icon image | ||
apple-touch-icon-72x72.png | Icon | Icon image | ||
apple-touch-icon.png | Icon | Icon image | ||
custom-icons.svg | Data | Auxiliary data | ||
favicon.ico | Data | Auxiliary data | ||
hierarchy-item.png | Icon | Icon image | ||
icon-class-13x13.png | Icon | Icon image | ||
icon-class.svg | Data | Auxiliary data | ||
icon-interface-13x13.png | Icon | Icon image | ||
icon-interface.svg | Data | Auxiliary data | ||
icon-trait-13x13.png | Icon | Icon image | ||
icon-trait.svg | Data | Auxiliary data |
Files | / | docs | / | api | / | images | / | iviewer |
File | Role | Description |
---|---|---|
grab.cur | Data | Auxiliary data |
hand.cur | Data | Auxiliary data |
iviewer.rotate_left.png | Icon | Icon image |
iviewer.rotate_right.png | Icon | Icon image |
iviewer.zoom_fit.png | Icon | Icon image |
iviewer.zoom_in.png | Icon | Icon image |
iviewer.zoom_out.png | Icon | Icon image |
iviewer.zoom_zero.png | Icon | Icon image |
Files | / | docs | / | api | / | img |
File | Role | Description | ||
---|---|---|---|---|
icons (22 files) | ||||
iviewer (12 files) | ||||
apple-touch-icon-114x114.png | Icon | Icon image | ||
apple-touch-icon-72x72.png | Icon | Icon image | ||
apple-touch-icon.png | Icon | Icon image | ||
favicon.ico | Data | Auxiliary data | ||
glyphicons-halflings-white.png | Icon | Icon image | ||
glyphicons-halflings.png | Icon | Icon image | ||
loader.gif | Icon | Icon image |
Files | / | docs | / | api | / | img | / | icons |
File | Role | Description |
---|---|---|
arrow_down.png | Icon | Icon image |
arrow_right.png | Icon | Icon image |
class.png | Icon | Icon image |
constant.png | Icon | Icon image |
favicon.ico | Data | Auxiliary data |
file-php.png | Icon | Icon image |
file.gif | Icon | Icon image |
folder.gif | Icon | Icon image |
function.png | Icon | Icon image |
icon-folder-open-big.png | Icon | Icon image |
icon-th-big.png | Icon | Icon image |
icon_template.svg | Data | Auxiliary data |
interface.png | Icon | Icon image |
method.png | Icon | Icon image |
ok.png | Icon | Icon image |
property.png | Icon | Icon image |
search.gif | Icon | Icon image |
variable.png | Icon | Icon image |
view_source.png | Icon | Icon image |
visibility_private.png | Icon | Icon image |
visibility_protected.png | Icon | Icon image |
visibility_public.png | Icon | Icon image |
Files | / | docs | / | api | / | img | / | iviewer |
File | Role | Description |
---|---|---|
grab.cur | Data | Auxiliary data |
hand.cur | Data | Auxiliary data |
iviewer.rotate_left.png | Icon | Icon image |
iviewer.rotate_right.png | Icon | Icon image |
iviewer.zoom_fit.png | Icon | Icon image |
iviewer.zoom_fit2.gif | Icon | Icon image |
iviewer.zoom_in.png | Icon | Icon image |
iviewer.zoom_in2.gif | Icon | Icon image |
iviewer.zoom_out.png | Icon | Icon image |
iviewer.zoom_out2.gif | Icon | Icon image |
iviewer.zoom_zero.png | Icon | Icon image |
iviewer.zoom_zero2.gif | Icon | Icon image |
Files | / | docs | / | api | / | js |
File | Role | Description | ||
---|---|---|---|---|
jqplot (8 files, 1 directory) | ||||
prettify (19 files) | ||||
ui (1 directory) | ||||
bootstrap.js | Data | Auxiliary data | ||
bootstrap.min.js | Data | Auxiliary data | ||
html5.js | Data | Auxiliary data | ||
jquery-1.11.0.min.js | Data | Auxiliary data | ||
jquery-1.4.2.min.js | Data | Auxiliary data | ||
jquery-1.7.1.min.js | Data | Auxiliary data | ||
jquery-ui-1.8.2.custom.min.js | Data | Auxiliary data | ||
jquery.cookie.js | Data | Auxiliary data | ||
jquery.dotdotdot-1.5.9.js | Data | Auxiliary data | ||
jquery.dotdotdot-1.5.9.min.js | Data | Auxiliary data | ||
jquery.iviewer.js | Data | Auxiliary data | ||
jquery.iviewer.min.js | Data | Auxiliary data | ||
jquery.mousewheel.js | Data | Auxiliary data | ||
jquery.mousewheel.min.js | Data | Auxiliary data | ||
jquery.panzoom.js | Data | Auxiliary data | ||
jquery.smooth-scroll.js | Data | Auxiliary data | ||
jquery.splitter.js | Data | Auxiliary data | ||
jquery.tools.min.js | Data | Auxiliary data | ||
jquery.treeview.js | Data | Auxiliary data | ||
jquery.xml2json.js | Data | Auxiliary data | ||
menu.js | Data | Auxiliary data | ||
prism.min.js | Data | Auxiliary data | ||
sidebar.js | Data | Auxiliary data | ||
SVGPan.js | Data | Auxiliary data | ||
template.js | Data | Auxiliary data |
Files | / | docs | / | api | / | js | / | jqplot |
File | Role | Description | ||
---|---|---|---|---|
plugins (30 files) | ||||
changes.txt | Doc. | Documentation | ||
copyright.txt | Doc. | Documentation | ||
excanvas.min.js | Data | Auxiliary data | ||
gpl-2.0.txt | Doc. | Documentation | ||
jquery.jqplot.min.css | Data | Auxiliary data | ||
jquery.jqplot.min.js | Data | Auxiliary data | ||
MIT-LICENSE.txt | Doc. | Documentation | ||
README.txt | Doc. | Documentation |
Files | / | docs | / | api | / | js | / | jqplot | / | plugins |
Files | / | docs | / | api | / | js | / | prettify |
File | Role | Description |
---|---|---|
lang-apollo.js | Data | Auxiliary data |
lang-clj.js | Data | Auxiliary data |
lang-css.js | Data | Auxiliary data |
lang-go.js | Data | Auxiliary data |
lang-hs.js | Data | Auxiliary data |
lang-lisp.js | Data | Auxiliary data |
lang-lua.js | Data | Auxiliary data |
lang-ml.js | Data | Auxiliary data |
lang-n.js | Data | Auxiliary data |
lang-proto.js | Data | Auxiliary data |
lang-scala.js | Data | Auxiliary data |
lang-sql.js | Data | Auxiliary data |
lang-tex.js | Data | Auxiliary data |
lang-vb.js | Data | Auxiliary data |
lang-vhdl.js | Data | Auxiliary data |
lang-wiki.js | Data | Auxiliary data |
lang-xq.js | Data | Auxiliary data |
lang-yaml.js | Data | Auxiliary data |
prettify.min.js | Data | Auxiliary data |
Files | / | docs | / | api | / | namespaces |
File | Role | Description |
---|---|---|
Am.Config.html | Doc. | Documentation |
Am.html | Doc. | Documentation |
default.html | Doc. | Documentation |
Files | / | docs | / | api | / | packages |
File | Role | Description |
---|---|---|
Am.Config.html | Doc. | Documentation |
Am.html | Doc. | Documentation |
default.html | Doc. | Documentation |
Files | / | docs | / | api | / | reports |
File | Role | Description |
---|---|---|
deprecated.html | Doc. | Documentation |
errors.html | Doc. | Documentation |
markers.html | Doc. | Documentation |
Files | / | examples | / | configs |
File | Role | Description |
---|---|---|
config-2.yaml | Data | Auxiliary data |
config-contains-mistakes.yaml | Data | Auxiliary data |
config.yaml | Data | Auxiliary data |
Files | / | tests | / | _reports | / | coverage |
File | Role | Description | ||
---|---|---|---|---|
.css (3 files) | ||||
.fonts (1 file) | ||||
.js (8 files) | ||||
Config.php.html | Doc. | Documentation | ||
dashboard.html | Doc. | Documentation | ||
index.html | Doc. | Documentation |
Files | / | tests | / | _reports | / | coverage | / | .css |
File | Role | Description |
---|---|---|
bootstrap.min.css | Data | Auxiliary data |
nv.d3.min.css | Data | Auxiliary data |
style.css | Data | Auxiliary data |
Files | / | tests | / | _reports | / | coverage | / | .fonts |
File | Role | Description |
---|---|---|
glyphicons-halflings-regular.svg | Data | Auxiliary data |
Files | / | tests | / | _reports | / | coverage | / | .js |
File | Role | Description |
---|---|---|
bootstrap.min.js | Data | Auxiliary data |
d3.min.js | Data | Auxiliary data |
file.js | Data | Auxiliary data |
holder.min.js | Data | Auxiliary data |
html5shiv.min.js | Data | Auxiliary data |
jquery.min.js | Data | Auxiliary data |
nv.d3.min.js | Data | Auxiliary data |
respond.min.js | Data | Auxiliary data |
php-configuration-lo-2017-09-26.zip 1062KB | |
php-configuration-lo-2017-09-26.tar.gz 968KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.