2017 © Pedro Peláez
 

library config

Yet another php configuration tool

image

yetanother/config

Yet another php configuration tool

  • Sunday, August 4, 2013
  • by yetanother
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Object-oriented configuration for PHP

YetAnother Config — простой менеджер конфигурационных файлов., (*1)

Установка

Рекомендуемая установка через composer:, (*2)

{
    "require": {
        "yetanother/config": "dev-master"
    }
}

Одиночный конфигурационный файл

// path/to/config.php

return array(
    'parameter1' => 'value1',
    'parameter2' => 'value2'
);
use YetAnother\Config\Config;

$config = new Config('path/to/config.php');
echo $config['parameter1']; // value1



## Директория с конфигурационными файлами
config ┕database.php ┕routing.php ┕security.php
```php
use YetAnother\Config\Config;

$config = new Config('path/to/config');
echo $config['database']['host'];
## Использование переменных вместо массива
// path/to/config.php

$parameter1 = 'value1';
$parameter2 = 'value2';
```php use YetAnother\Config\Config; $config = new Config('path/to/config.php'); echo $config['parameter1'];

## Включение других конфигурационных файлов
config ┕config.php ┕database.php ┕routing.php ┕security.php
```php
// config.php

$database = include(__DIR__.'/database.php');
$routing = include(__DIR__.'/routing.php');
$security = include(__DIR__.'/security.php');
// или
$database = $this->import('database');
$routing = $this->import('routing');
$security = $this->import('security');
// или
$database = $this->import(__DIR__.'/database.php');
$routing = $this->import(__DIR__.'/routing.php');
$security = $this->import(__DIR__.'/security.php');
```php use YetAnother\Config\Config; $config = new Config('config/config.php'); echo $config['database']['host'];

The Versions

04/08 2013

dev-master

9999999-dev https://github.com/yetanotherphp/config

Yet another php configuration tool

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

config