fobia/php-configuration

PHP Configuration

v1.3 2015-05-26 00:19 UTC

This package is not auto-updated.

Last update: 2024-11-09 18:22:11 UTC


README

Конфигурация в виде массива.

See Slimframework

Installation / Usage

{
    "require": {
        "fobia/php-configuration": "*"
    }
}
<?php
use Fobia\Configuration\Configuration;

$config = new Configuration();
$config->setArray(array(
    'path1.to1' => 'value11',
    'path1.to2' => 'value12',
    'path2' => array(
        'to1' => 'value21'
    )
));


// Array (
//     [to1] => value11 
//     [to2] => value12
// )
print_r($config['path1']);  

echo $config['path1.to1'];    // 'value11'
echo $config['path1']['to2']; // 'value12'
echo $config['path2']['to1']; // 'value21'
?>