FastForward Config is a flexible and modern PHP configuration library built for performance, extendability, and lazy-loading behavior. It supports dot-notation keys, recursive directory loading, Laminas-compliant configuration providers, and optional PSR-16 caching.
- π Dot notation access:
config->get('app.env') - π Load from arrays, directories, or providers
- β»οΈ Lazy-loading with
__invoke() - π§© Aggregation of multiple sources
- π Recursive directory support
- πΎ Optional PSR-16 compatible caching
- π Compatible with Laminas ConfigProviders
composer require fast-forward/config
use FastForward\Config\{config, configDir, configCache}; use Symfony\Component\Cache\Simple\FilesystemCache; $config = config( ['app' => ['env' => 'production']], __DIR__ . '/config', \Vendor\Package\ConfigProvider::class ); echo $config->get('app.env'); // "production"
$cache = new FilesystemCache(); $config = configCache( cache: $cache, ['foo' => 'bar'] ); echo $config->get('foo'); // "bar"
$config = configDir(__DIR__ . '/config', recursive: true);
$config = configProvider([ new Vendor\Package\Provider1(), new Vendor\Package\Provider2(), ]);
$config->set('db.host', 'localhost'); echo $config->get('db.host'); // "localhost" $config->has('app.debug'); // true/false print_r($config->toArray());
config/
βββ app.php
βββ db.php
βββ services/
βββ mail.php
config(...$configs): ConfigInterfaceconfigCache(CacheInterface $cache, ...$configs): ConfigInterfaceconfigDir(string $dir, bool $recursive = false, ?string $cache = null): ConfigInterfaceconfigProvider(iterable $providers, ?string $cache = null): ConfigInterface
MIT Β© 2025 Felipe SayΓ£o Lobato Abreu