Getting Started
Ferret is a configuration management library for PHP that supports multiple formats including PHP arrays, JSON, YAML, TOML, INI, XML, and NEON.
Installation
Section titled “Installation”composer require cline/ferretBasic Usage
Section titled “Basic Usage”use Cline\Ferret\Config;
// Load a configuration file$config = Config::load('config.json');
// Access values$value = $config->get('database.host');
// Set values$config->set('database.port', 3306);
// Save changes$config->save('config.json');Supported Formats
Section titled “Supported Formats”Ferret automatically detects the format based on file extension:
| Extension | Format |
|---|---|
.php | PHP array |
.json | JSON |
.yaml, .yml | YAML |
.toml | TOML |
.ini | INI |
.xml | XML |
.neon | NEON |
Next Steps
Section titled “Next Steps”- Directory Loading - Load entire configuration directories
- Format Conversion - Convert between formats
- Typed Accessors - Type-safe value access
- Encryption - Protect sensitive values