Download the PHP package jamesgober/config without Composer
On this page you can find all versions of the php package jamesgober/config. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jamesgober/config
More information about jamesgober/config
Files in jamesgober/config
Package config
Short Description Advanced PHP configuration management designed for flexibility and performance, with built-in support for JSON, YAML, XML, INI, and limitless custom formats.
License MIT
Homepage https://github.com/jamesgober/Config
Informations about the package config
CONFIG MANAGER
BY JAMES GOBER
A Flexible PHP Configuration Manager
Config is a lightweight yet powerful PHP library designed to handle your application's configuration needs with ease and efficiency. Supporting multiple formats like JSON, XML, YAML, INI, and PHP arrays out of the box, it provides the flexibility to add custom parsers tailored to your specific requirements. With robust error handling, performance-focused design, and a modular architecture, JG\Config simplifies configuration management for modern PHP projects.
Key Features
- Multi-Format Support: Seamlessly load configurations from JSON, XML, YAML, INI, PHP, and CONF files.
- Custom Parsers: Extend functionality by adding support for any file format with ease.
- Performance Optimizations: Designed for speed, even with large or deeply nested configurations.
- Advanced Features: Includes caching, dynamic flattening control, and stream parsing for modern workflows.
- Robust Error Handling: Custom exceptions provide clear and actionable feedback for debugging.
- Lightweight and Intuitive: A simple yet powerful API designed for minimal overhead and ease of use.
Why Choose This Library?
JG\Config is built for developers who demand efficiency, reliability, and flexibility in their projects:
- High Performance: Optimized for speed with low overhead, making it ideal for high-load scenarios.
- Modular Design: Extend or replace parsers effortlessly to meet custom needs.
- Error-Resilient: Provides comprehensive error handling with meaningful exception messages.
- Extensively Tested: Rigorously tested with PHPUnit for predictable and stable performance.
- Built on Principles: Adheres to S.O.L.I.D design principles and emphasizes maintainability and extensibility.
Whether you're building a small application or managing a large-scale project, JG\Config provides a robust solution to streamline your configuration management.
Installation
Install via composer:
Quick Start
Load Configurations
Effortlessly load multiple configuration files in various formats:
Manage Configurations
Easily delete individual values or entire groups:
Extend with Custom Parsers
Add support for new file formats via custom parsers:
Supported Formats
Format | Example | Extension |
---|---|---|
CONF | config.conf |
.conf |
INI | config.ini |
.ini |
JSON | config.json |
.json |
PHP Array | config.php |
.php |
XML | config.xml |
.xml |
YAML | config.yaml |
.yaml , .yml |
For more examples, see our Advanced Usage guide.
Error Handling
Custom Exceptions
JG\Config uses custom exceptions for intuitive error handling:
Exception | Description |
---|---|
ConfigException |
General errors related to configuration. |
ConfigParseException |
Errors when parsing configuration files. |
InvalidParserException |
When unsupported or invalid parsers are used. |
Example Usage:
Advanced Features
Explore advanced capabilities like caching, custom parsers, and dynamic flattening in our Advanced Guide.
Directory Structure
Reporting Security Issues
We take security seriously. If you find a vulnerability, please consult our SECURITY POLICY and follow the instructions for reporting.
Do not use public issue trackers or forums to disclose sensitive information.
Reporting Bugs and Feature Requests
For non-security issues, such as bugs or feature requests, please use our Issue Tracker. Providing detailed information will help us resolve issues efficiently.
Design Philosophy
Learn about the principles that guide the development of JG\Config in our Design Philosophy.
Contributing
Contributions are welcome! Check out the Code of Conduct for more information.
License
This library is open-source software licensed under the MIT license.
TOP
COPYRIGHT © 2024 JAMES GOBER & JAMESGOBER.COM.
All versions of config with dependencies
ext-json Version *
ext-xml Version *
symfony/yaml Version ^7.1
psr/http-message Version ^2.0