Вход Регистрация
Файл: system/src/System/Container/Config.php
Строк: 50
<?php

/**
 * This file is part of JohnCMS Content Management System.
 *
 * @copyright JohnCMS Community
 * @license   https://opensource.org/licenses/GPL-3.0 GPL-3.0
 * @link      https://johncms.com JohnCMS Project
 */

declare(strict_types=1);

namespace 
JohncmsSystemContainer;

use 
JohncmsConfigProvider as JohncmsConfigProvider;
use 
LaminasConfigAggregator{
    
ArrayProvider,
    
ConfigAggregator,
    
PhpFileProvider
};

class 
Config
{
    
/** @var string */
    
private $cacheFile 'system-config.cache';

    public function 
__invoke(): array
    {
        
$aggregator = new ConfigAggregator(
            [
                
// Include cache configuration
                
new ArrayProvider(['config_cache_path' => $this->cacheFile]),

                
// Include packages configuration
                
JohncmsConfigProvider::class,

                
// Load application config in a pre-defined order
                
new PhpFileProvider(CONFIG_PATH 'autoload/{{,*.}global,{,*.}local}.php'),
            ],
            
$this->cacheFile
        
);

        return 
$aggregator->getMergedConfig();
    }
}
Онлайн: 0
Реклама