skies-api/config/config.php

41 lines
1.2 KiB
PHP
Raw Permalink Normal View History

<?php
declare(strict_types=1);
2017-11-06 13:18:39 +01:00
use Zend\ConfigAggregator\ArrayProvider;
use Zend\ConfigAggregator\ConfigAggregator;
use Zend\ConfigAggregator\PhpFileProvider;
2017-11-06 13:18:39 +01:00
// To enable or disable caching, set the `ConfigAggregator::ENABLE_CACHE` boolean in
// `config/autoload/local.php`.
$cacheConfig = [
'config_cache_path' => 'data/config-cache.php',
];
2017-11-06 13:18:39 +01:00
$aggregator = new ConfigAggregator([
\Zend\Log\ConfigProvider::class,
\Zend\HttpHandlerRunner\ConfigProvider::class,
2017-11-06 13:18:39 +01:00
// Include cache configuration
new ArrayProvider($cacheConfig),
\Zend\Expressive\Helper\ConfigProvider::class,
\Zend\Expressive\ConfigProvider::class,
\Zend\Expressive\Router\ConfigProvider::class,
2017-11-06 13:18:39 +01:00
// Default App module config
App\ConfigProvider::class,
2017-11-06 13:18:39 +01:00
// Load application config in a pre-defined order in such a way that local settings
// overwrite global settings. (Loaded as first to last):
// - `global.php`
// - `*.global.php`
// - `local.php`
// - `*.local.php`
new PhpFileProvider('config/autoload/{{,*.}global,{,*.}local}.php'),
2017-11-06 13:18:39 +01:00
// Load development config if it exists
new PhpFileProvider('config/development.config.php'),
], $cacheConfig['config_cache_path']);
return $aggregator->getMergedConfig();