Autarky\Config\ConfigProvider::getConfigStore PHP Метод

getConfigStore() защищенный Метод

protected getConfigStore ( )
    protected function getConfigStore()
    {
        $dic = $this->app->getContainer();
        // set up the factory
        $loaderFactory = new LoaderFactory($dic);
        $dic->instance('Autarky\\Config\\Loaders\\LoaderFactory', $loaderFactory);
        // set up the config store
        $store = new FileStore(new PathResolver($this->configPath), $loaderFactory, $this->app->getEnvironment());
        $dic->instance('Autarky\\Config\\FileStore', $store);
        $dic->alias('Autarky\\Config\\FileStore', 'Autarky\\Config\\ConfigInterface');
        // set up the PHP file loader
        $dic->share('Autarky\\Config\\Loaders\\PhpFileLoader');
        $loaderFactory->addLoader('.php', 'Autarky\\Config\\Loaders\\PhpFileLoader');
        // set up the YAML config file loaders
        $dic->define('Autarky\\Config\\Loaders\\YamlFileLoader', function (ContainerInterface $dic) {
            return new YamlFileLoader($dic->resolve('Symfony\\Component\\Yaml\\Parser'));
        });
        $dic->share('Autarky\\Config\\Loaders\\YamlFileLoader');
        $yamlCachePath = $this->getYamlCachePath($store);
        $dic->define('Autarky\\Config\\Loaders\\CachingYamlFileLoader', function (ContainerInterface $dic) use($yamlCachePath) {
            return new CachingYamlFileLoader($dic->resolve('Symfony\\Component\\Yaml\\Parser'), $yamlCachePath);
        });
        $dic->share('Autarky\\Config\\Loaders\\CachingYamlFileLoader');
        $loader = $yamlCachePath ? 'Autarky\\Config\\Loaders\\CachingYamlFileLoader' : 'Autarky\\Config\\Loaders\\YamlFileLoader';
        $loaderFactory->addLoader(['.yml', '.yaml'], $loader);
        // done!
        return $store;
    }