Files
shlink/config/config.php
T

43 lines
1.5 KiB
PHP
Raw Normal View History

2016-04-10 09:38:07 +02:00
<?php
2019-10-05 17:26:10 +02:00
2017-10-12 10:13:20 +02:00
declare(strict_types=1);
namespace Shlinkio\Shlink;
2020-01-01 21:11:53 +01:00
use Laminas\ConfigAggregator;
2020-10-16 19:21:40 +02:00
use Laminas\Diactoros;
2020-01-01 21:11:53 +01:00
use Mezzio;
2024-10-23 10:53:09 +02:00
use Shlinkio\Shlink\Core\Config\EnvVars;
2021-12-06 17:15:19 +01:00
return new ConfigAggregator\ConfigAggregator(
2023-06-04 12:40:10 +02:00
providers: [
Mezzio\ConfigProvider::class,
Mezzio\Router\ConfigProvider::class,
Mezzio\Router\FastRouteRouter\ConfigProvider::class,
2026-04-02 12:39:46 +02:00
Mezzio\ProblemDetails\ConfigProvider::class,
Mezzio\Valinor\ConfigProvider::class,
2023-06-04 12:40:10 +02:00
Diactoros\ConfigProvider::class,
Common\ConfigProvider::class,
Config\ConfigProvider::class,
Importer\ConfigProvider::class,
IpGeolocation\ConfigProvider::class,
EventDispatcher\ConfigProvider::class,
Core\ConfigProvider::class,
CLI\ConfigProvider::class,
Rest\ConfigProvider::class,
new ConfigAggregator\PhpFileProvider('config/autoload/{,*.}global.php'),
2024-10-23 10:53:09 +02:00
// Test config should be loaded ONLY during tests
EnvVars::isTestEnv()
? new ConfigAggregator\PhpFileProvider('config/test/*.global.php')
: new ConfigAggregator\ArrayProvider([]),
2023-06-04 12:40:10 +02:00
// Routes have to be loaded last
new ConfigAggregator\PhpFileProvider('config/autoload/routes.config.php'),
],
cachedConfigFile: 'data/cache/app_config.php',
postProcessors: [
Core\Config\PostProcessor\BasePathPrefixer::class,
Core\Config\PostProcessor\MultiSegmentSlugProcessor::class,
Core\Config\PostProcessor\ShortUrlMethodsProcessor::class,
],
)->getMergedConfig();