Download the PHP package jsc-php/configs without Composer
On this page you can find all versions of the php package jsc-php/configs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package configs
Configs
A simple and flexible PHP library for parsing and writing configuration files. Supports JSON, YAML, INI, and XML formats with ease.
Features
- Multi-format Support: Seamlessly handle
.json,.yaml,.ini,.php, and.xmlfiles. - Magic Access: Access and modify configuration data using PHP magic properties.
- Auto-save: Automatically persists changes back to the file when the object is destroyed (can be disabled)[^1].
- Format Conversion: Easily convert configuration files between supported formats.
- Type Safety: Built for PHP 8.5+ with modern syntax.
Installation
Install via Composer:
Note: Requires the ext-yaml PHP extension for YAML support.
Usage
Basic Example
Options
You can disable autosave in the constructor:
Converting Formats
Convert an existing configuration to a different format:
Deleting Keys
Supported Formats
- JSON: Uses native
json_encodeandjson_decode. - YAML: Uses
yaml_emitandyaml_parse(requiresext-yaml). - INI: Uses
parse_ini_filewith typed scanning and a custom writer supporting sections and multi-value keys. - PHP: Uses
var_export()to create a return value - XML: Uses
SimpleXMLfor parsing and DOM for formatted output with proper indentation.
License
This project is licensed under the GPL-3.0 License.
[^1]: To save changes, the config file must be writable
Authors
- James Cavaliere - [email protected]
All versions of configs with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.5
ext-yaml Version *
ext-simplexml Version *
ext-dom Version *
ext-yaml Version *
ext-simplexml Version *
ext-dom Version *
The package jsc-php/configs contains the following files
Loading the files please wait ...