ofcold / component-config
Manage Ofcold configuration by persistent storage.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ofcold/component-config
Requires
- php: ^7.4|^8.0
- illuminate/support: ^8.0|^9.0
- symfony/finder: ^5.1
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^10
This package is auto-updated.
Last update: 2025-10-09 17:19:22 UTC
README
Manage Promise configuration by persistent storage.
Installing
composer require ofcold/component-config
Useing
$config = new Ofcold\Component\Config\Repository // Set initial configuration items $config->addNamespace('your-config-path'); // Add a namespace to configuration. $config->addNamespace(__DIR__ '/your-path/config', 'user'); // Get a config item. $config->get('foo'); // Get a namespace config item. $config->get('user::foo.bar');
Api
| Method | Description |
|---|---|
| addNamespace(string $directory, ?string $namespace = null): void | Add a namespace to configuration. |
| has($key): bool | Determine if the given configuration value exists. |
| get($key, $default = null) | Get the specified configuration value. |
| getMany(array $keys): array | Get many configuration values. |
| set($key, $value = null): void | Set a given configuration value. |
| prepend($key, $value): void | Prepend a value onto an array configuration value. |
| push($key, $value): void | Push a value onto an array configuration value. |
| all(): array | Get all of the configuration items for the application.. |