|
|
1 年之前 | |
|---|---|---|
| .. | ||
| src | 2 年之前 | |
| .coveralls.yml | 2 年之前 | |
| .travis.yml | 2 年之前 | |
| README.md | 2 年之前 | |
| composer.json | 2 年之前 | |
| phpunit.xml | 2 年之前 | |
Read and write INI configurations.
composer require piwik/ini
PHP provides a parse_ini_file() function to read INI files.
This component provides the following benefits over the built-in function:
true/false, on/off, yes/no) to real PHP booleans (instead of strings "1" and "")null (instead of an empty string)parse_ini_file() or parse_ini_string() is disabled in php.ini by falling back on an alternate implementation (can happen on some shared hosts)$reader = new IniReader();
// Read a string
$array = $reader->readString($string);
// Read a file
$array = $reader->readFile('config.ini');
$writer = new IniWriter();
// Write to a string
$string = $writer->writeToString($array);
// Write to a file
$writer->writeToFile('config.ini', $array);
The Ini component is released under the LGPL v3.0.
To run the unit tests:
vendor/bin/phpunit
To run the performance tests:
php -n vendor/bin/athletic -p tests/PerformanceTest