gallery-api/config/config.php

43 lines
1.4 KiB
PHP
Raw Normal View History

2017-07-21 19:59:16 +02:00
<?php
2020-04-23 18:26:12 +02:00
declare(strict_types=1);
2017-07-21 19:59:16 +02:00
use Zend\ConfigAggregator\ArrayProvider;
use Zend\ConfigAggregator\ConfigAggregator;
use Zend\ConfigAggregator\PhpFileProvider;
// To enable or disable caching, set the `ConfigAggregator::ENABLE_CACHE` boolean in
// `config/autoload/local.php`.
$cacheConfig = [
2020-04-23 18:26:12 +02:00
'config_cache_path' => 'data/cache/config-cache.php',
2017-07-21 19:59:16 +02:00
];
$aggregator = new ConfigAggregator([
2020-04-23 18:26:12 +02:00
\Zend\Expressive\ConfigProvider::class,
\Zend\Expressive\Helper\ConfigProvider::class,
\Zend\Expressive\Router\FastRouteRouter\ConfigProvider::class,
\Zend\Expressive\Router\ConfigProvider::class,
\Zend\HttpHandlerRunner\ConfigProvider::class,
\Zend\Log\ConfigProvider::class,
2017-07-21 19:59:16 +02:00
// Include cache configuration
new ArrayProvider($cacheConfig),
// Default App module config
App\ConfigProvider::class,
2020-04-23 18:26:12 +02:00
ApiLibs\ConfigProvider::class,
2017-07-21 19:59:16 +02: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`
2020-04-23 18:26:12 +02:00
new PhpFileProvider(realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php'),
2017-07-21 19:59:16 +02:00
// Load development config if it exists
2020-04-23 18:26:12 +02:00
new PhpFileProvider(realpath(__DIR__) . '/development.config.php'),
2017-07-21 19:59:16 +02:00
], $cacheConfig['config_cache_path']);
return $aggregator->getMergedConfig();