shlink/config/config.php

29 lines
993 B
PHP
Raw Normal View History

2016-04-10 02:38:07 -05:00
<?php
2016-07-19 09:50:02 -05:00
use Shlinkio\Shlink\CLI;
2016-07-19 10:38:41 -05:00
use Shlinkio\Shlink\Common;
2016-07-19 11:01:39 -05:00
use Shlinkio\Shlink\Core;
2016-07-19 10:07:59 -05:00
use Shlinkio\Shlink\Rest;
2016-07-19 09:30:48 -05:00
use Zend\Expressive\ConfigManager\ConfigManager;
use Zend\Expressive\ConfigManager\ZendConfigProvider;
2016-04-10 02:38:07 -05:00
/**
* Configuration files are loaded in a specific order. First ``global.php``, then ``*.global.php``.
* then ``local.php`` and finally ``*.local.php``. This way local settings overwrite global settings.
*
* The configuration can be cached. This can be done by setting ``config_cache_enabled`` to ``true``.
*
* Obviously, if you use closures in your config you can't cache it.
*/
2016-07-19 09:30:48 -05:00
return call_user_func(function () {
$configManager = new ConfigManager([
2016-07-19 10:38:41 -05:00
Common\ConfigProvider::class,
2016-07-19 11:01:39 -05:00
Core\ConfigProvider::class,
2016-07-19 10:07:59 -05:00
CLI\ConfigProvider::class,
Rest\ConfigProvider::class,
new ZendConfigProvider('config/autoload/{{,*.}global,{,*.}local}.php'),
2016-07-19 09:30:48 -05:00
], 'data/cache/app_config.php');
2016-04-10 02:38:07 -05:00
2016-07-19 09:30:48 -05:00
return $configManager->getMergedConfig();
});