https://github.com/marella/phig
PHP Config library.
https://github.com/marella/phig
Last synced: 5 months ago
JSON representation
PHP Config library.
- Host: GitHub
- URL: https://github.com/marella/phig
- Owner: marella
- License: mit
- Created: 2016-03-03T06:40:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-20T16:34:27.000Z (about 10 years ago)
- Last Synced: 2025-01-26T10:08:42.500Z (over 1 year ago)
- Language: PHP
- Homepage: https://github.com/marella/phig/wiki
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Phig
[](https://coveralls.io/github/marella/phig?branch=master)
[](https://travis-ci.org/marella/phig)
[](https://styleci.io/repos/53027491)
[](https://packagist.org/packages/marella/phig) [](https://packagist.org/packages/marella/phig) [](https://packagist.org/packages/marella/phig) [](https://packagist.org/packages/marella/phig)
PHP Config Library.
### Quick Usage
```sh
composer require marella/phig
```
```php
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
'UTC',
'locale' => 'en',
];
```
`database.php`
```php
'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][license].
[wiki]: https://github.com/marella/phig/wiki
[contributing guidelines]: /.github/CONTRIBUTING.md
[license]: /LICENSE