marella / phig
PHP Config library.
Installs: 2 123
Dependents: 0
Suggesters: 1
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.5
Requires (Dev)
- fabpot/php-cs-fixer: ^1.11
- mockery/mockery: ~0.9.4
- phpunit/php-code-coverage: ^2
- phpunit/phpunit: 4.8.*
- satooshi/php-coveralls: ^1.0
- symfony/yaml: ^3.0
Suggests
- symfony/yaml: Required to parse YAML files (^3.0).
This package is not auto-updated.
Last update: 2024-11-06 23:32:15 UTC
README
PHP Config Library.
Quick Usage
composer require marella/phig
<?php require 'vendor/autoload.php'; $loader = new \Phig\ConfigLoader(); $config = $loader->read(__DIR__.'/config'); $timezone = $config['app.timezone']; // 'UTC' $locale = $config['app']['locale']; // 'en' $database = $config['database']; // array $host = $database['host']; // 'localhost'
where config
directory contains these files:
app.php
<?php return [ 'timezone' => 'UTC', 'locale' => 'en', ];
database.php
<?php return [ 'host' => 'localhost', 'database' => 'forge', 'username' => 'forge', 'password' => '', ];
Documentation
See the wiki for more details and documentation.
Contributing
See contributing guidelines before creating issues or pull requests.
License
Open-source software released under the MIT license.