Recommend this page to a friend! |
Classes of Filip Štamcar | PHP Configuration Writer | README.md | Download |
|
DownloadPHP Config Writer[![Latest Stable Version][icon-stable-version]][link-packagist] [![Latest Untable Version][icon-unstable-version]][link-packagist] [![Total Downloads][icon-downloads]][link-packagist] [![License][icon-license]][link-license] [![PHP][icon-php]][link-php] [![Linux Build Status][icon-travis]][link-travis] [![Windows Build Status][icon-appveyor]][link-appveyor] [![Code Coverage][icon-coverage]][link-coverage] [![Code Quality][icon-quality]][link-quality] Lightweight configuration writer for PHP. InstallationRequirementsMonologPHPMailer requires [PHP][link-php] 5.5.9 or higher. Also, the config directory needs to be writable by web server in order to save config file. Using ComposerThe reccomended way to install ConfigWriter is with [Composer][link-composer], dependency manager for PHP. You should just require
You would only need to include autoloader and namespace in your script.
Manually InstallationAlternatively, you could download files from GitHub and then manually include them in your script. You whould need to include all files and namespace in your script.
UsageMaking the configurationConfiguration making is possible using
It accepts two parameters, data and comment, and both are optional. Data parameter contains pre-set data for configuration and comment contains additional comment (or code) on top of the configuration file.
Adding recordsRecords can be added using
They can also have comments, which will be generated in documentation.
Adding sectionsSections visually and functionally separate multiple records. They can be added using
They can also have pre-set data using second parameter.
Saving configurationYou can save configuration using When saving to string, configuration writer is required, and when saving to file, writer will be automatically determined.
Writers can also have specific options for writing.
The only supported writer is for PHP array, but more writers will be added later. VersioningThis project uses [SemVer][link-semver] for versioning. For the versions available, see the [tags on this repository][link-tags]. LicenseThis project is licensed under the MIT license. See the [ [icon-stable-version]: https://img.shields.io/packagist/v/filips123/config-writer.svg?style=flat-square&label=Latest+Stable+Version [icon-unstable-version]: https://img.shields.io/packagist/vpre/filips123/config-writer.svg?style=flat-square&label=Latest+Unstable+Version [icon-downloads]: https://img.shields.io/packagist/dt/filips123/config-writer.svg?style=flat-square&label=Downloads [icon-license]: https://img.shields.io/packagist/l/filips123/config-writer.svg?style=flat-square&label=License [icon-php]: https://img.shields.io/packagist/php-v/filips123/config-writer.svg?style=flat-square&label=PHP [icon-travis]: https://img.shields.io/travis/com/filips123/ConfigWriter.svg?style=flat-square&label=Linux+Build+Status [icon-appveyor]: https://img.shields.io/appveyor/ci/filips123/ConfigWriter.svg?style=flat-square&label=Windows+Build+Status [icon-coverage]: https://img.shields.io/scrutinizer/coverage/g/filips123/ConfigWriter.svg?style=flat-square&label=Code+Coverage [icon-quality]: https://img.shields.io/scrutinizer/g/filips123/ConfigWriter.svg?style=flat-square&label=Code+Quality [link-packagist]: https://packagist.org/packages/filips123/config-writer/ [link-license]: https://choosealicense.com/licenses/mit/ [link-php]: https://php.net/ [link-composer]: https://getcomposer.org/ [link-travis]: https://travis-ci.com/filips123/ConfigWriter/ [link-appveyor]: https://ci.appveyor.com/project/filips123/configwriter/ [link-coverage]: https://scrutinizer-ci.com/g/filips123/ConfigWriter/code-structure/ [link-quality]: https://scrutinizer-ci.com/g/filips123/ConfigWriter/ [link-semver]: https://semver.org/ [link-tags]: https://github.com/filips123/ConfigWriter/tags/ [link-license-file]: https://github.com/filips123/ConfigWriter/blob/master/LICENSE |