https://github.com/activecollab/configfile
Get configuration constants from a configuration file written in PHP
https://github.com/activecollab/configfile
Last synced: 11 months ago
JSON representation
Get configuration constants from a configuration file written in PHP
- Host: GitHub
- URL: https://github.com/activecollab/configfile
- Owner: activecollab
- License: mit
- Created: 2015-08-09T09:30:34.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-04T09:32:55.000Z (over 10 years ago)
- Last Synced: 2025-06-10T03:52:32.460Z (about 1 year ago)
- Language: PHP
- Homepage: https://labs.activecollab.com
- Size: 131 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ConfigFile Library
[](https://travis-ci.org/activecollab/configfile)
Simple utility for getting constants from configuration files written in PHP.
## Installation
To install it, use Composer:
```json
{
"require": {
"activecollab/configfile": "~1.0"
}
}
```
## Usage
If we have a `config.example.php` file that looks like this:
```php
getOptions());
```
we'll get:
```
array(8) {
["ONE"]=>
int(1)
["TWO"]=>
int(2)
["THREE"]=>
int(3)
["THIS_IS_TRUE"]=>
bool(true)
["THIS_IS_FALSE"]=>
bool(false)
["SINGLE_QUOTED_STRING"]=>
string(6) "single"
["DOUBLE_QUOTED_STRING"]=>
string(6) "double"
["FLOAT"]=>
float(2.25)
}
```
## To Do
This library has been created in a bit of a rush, so there are still some things to do:
1. `const` should be parsed using tokenizer
2. Follow included files using `include` and `require` [?]
3. Library should be able to modify and write config files [?]