Bolt\Config::initialize PHP Method

initialize() public method

public initialize ( )
    public function initialize()
    {
        $this->fields = new Storage\Field\Manager();
        $this->defaultConfig = $this->getDefaults();
        $this->cacheFile = $this->app['filesystem.cache']->getFile('config-cache.json');
        $data = $this->loadCache();
        if ($data === null) {
            $data = $this->getConfig();
            // If we have to reload the config, we will also want to make sure
            // the DB integrity is checked.
            $this->app['schema.timer']->setCheckRequired();
        }
        $this->data = $data;
        $this->loadTheme();
        $this->setCKPath();
        $this->parseTemplatefields();
    }

Usage Example

Example #1
0
 public function register(Application $app)
 {
     $app['config'] = $app->share(function ($app) {
         $config = new Config($app);
         $config->initialize();
         return $config;
     });
     $app['config.environment'] = $app->share(function ($app) {
         $appPath = $app['resources']->getPath('app');
         $viewPath = $app['resources']->getPath('view');
         $environment = new Environment($appPath, $viewPath, $app['cache'], $app['extend.action'], Bolt\Version::VERSION);
         return $environment;
     });
     $app['config.validator'] = $app->share(function ($app) {
         $validator = new ConfigValidator($app['controller.exception'], $app['config'], $app['resources']);
         return $validator;
     });
     $app['config.listener'] = $app->share(function ($app) {
         return new ConfigListener($app);
     });
     if (!isset($app['config.pre_boot'])) {
         $this->preBoot($app['resources']);
         $app['config.pre_boot'] = true;
     }
 }
All Usage Examples Of Bolt\Config::initialize