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/configuse 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): ConfigInterface
- configCache(CacheInterface $cache, ...$configs): ConfigInterface
- configDir(string $dir, bool $recursive = false, ?string $cache = null): ConfigInterface
- configProvider(iterable $providers, ?string $cache = null): ConfigInterface
MIT © 2025 Felipe Sayão Lobato Abreu