Initializes cache configuration.

@return void
556546
protected function _initCache()
    {
        if (!Cache::getConfig(static::$cacheConfig)) {
            Cache::setConfig(static::$cacheConfig, [
                'className' => $this->_getDefaultCacheConfigClassName(),
                'prefix' => static::$cacheConfig . '_' . $this->_identifier,
                'duration' => $this->getConfig('interval'),
            ]);
        }
    }
382188
public function initialize()
    {
        // check if we have already initialized the router
        if ($this->initializedFlag) {
            return;
        }

        // do initialization
        $this->loader = new ConfigLoader(self::getConfig()->get('Routes', new ConfigObject([])));
        self::$routeCollection = $this->loader->getRouteCollection();
        $this->urlMatcher = new UrlMatcher();
        $this->urlGenerator = new UrlGenerator();

        $this->setCache(self::getConfig()->get('Cache', false));
        $this->initializedFlag = true;
    }
387178
def _init_cache(self):
        """"""
        self._add_cache = defaultdict(list)
        self._reverse_add_cache = defaultdict(list)
        self._undefined_cache = {}
        self._remove_cache = {}
1069758
protected function memcache_init()
    {
        $this->mc_available = 0;

        // add all configured hosts to pool
        $pconnect       = $this->config->get('memcache_pconnect', true);
        $timeout        = $this->config->get('memcache_timeout', 1);
        $retry_interval = $this->config->get('memcache_retry_interval', 15);

        foreach ($this->config->get('memcache_hosts', array()) as $host) {
            if (substr($host, 0, 7) != 'unix://') {
                list($host, $port) = explode(':', $host);
                if (!$port) $port = 11211;
            }
            else {
                $port = 0;
            }

            $this->mc_available += intval($this->memcache->addServer(
                $host, $port, $pconnect, 1, $timeout, $retry_interval, false, array($this, 'memcache_failure')));
        }
    }
956153
protected function initConfig(): void
    {
        $loader = new ConfigLoader();
        $loader->setPath($this->getPath());
        $loader->setEnvironment($this->getEnvironment());
        $loader->load();

        $config = new \Bluz\Config\Config();
        $config->setFromArray($loader->getConfig());

        Config::setInstance($config);

        // setup configuration for current environment
        if ($debug = Config::get('debug')) {
            $this->debugFlag = (bool)$debug;
        }

        // initial php settings
        if ($ini = Config::get('php')) {
            foreach ($ini as $key => $value) {
                $result = ini_set($key, $value);
                Logger::info('app:init:php:' . $key . ':' . ($result ?: '---'));
            }
        }
    }
231793
public function init()
	{
		if($this->getIsContentCached())
			$this->replayActions();
		elseif($this->_cache!==null)
		{
			$this->getController()->getCachingStack()->push($this);
			ob_start();
			ob_implicit_flush(false);
		}
	}
1253356
public function initConfigs()
    {
        // Check configurations
        if (empty($this->configurations)) {
            return;
        }

        // Get available configurations
        $available = $this->getConfigurations();

        // Iterate
        foreach ($this->configurations as $component => $file) {
            // Check if configuration asked exists
            if (!array_key_exists($component, $available)) {
                continue;
            }

            $service = $this->get($component);

            // Check service integrity
            if (!$service) {
                continue;
            }

            // Initialize service
            $service->setPath($file);
            $service->init();
        }
    }
1112419
public function init() {
        $this->cachePath = PathUtility::mapPath($this->config->cachePath);
        $this->accessTime = (isset($this->config->accessTime) ? (int)$this->config->accessTime : 100) * 1000;
        $this->hash = (isset($this->config->hash) ? $this->config->hash : null);
    }
1284188
public function init()
    {
        if ($this->isConfigConsistent()) {
            $this->setSaml(new Saml(
                Metadata::load(
                    $this->getConfig()->getSamlMetadataBaseDir() . '/' .$this->getConfig()->getIdpMetadataFile(),
                    $this->getConfig()->getSamlMetadataBaseDir() . '/' .$this->getConfig()->getSpMetadataFile()
                ),
                $this->getConfig()->getPrivateKey()
            ));
        } else {
            $metadata = new Metadata();
            $metadata->setIdentityProvider(
                $metadata->createEntityDescriptor(
                    file_get_contents(
                        $this->getConfig()->getSamlMetadataBaseDir() . '/' .$this->getConfig()->getIdpMetadataFile()
                    )
                )
            );

            $this->setSaml(new Saml($metadata, $this->getConfig()->getPrivateKey()));
        }
    }
1289430
public function loadConfigurationCache(): bool
    {
        $cachePathAndFilename = $this->constructConfigurationCachePath();
        $configurations = @include $cachePathAndFilename;
        if ($configurations !== false) {
            $this->configurations = $configurations;
            return true;
        }

        return false;
    }
954011
public static function init()
    {
        self::$loader = new Twig_Loader_Filesystem();

        $config = Config::getInstance();

        foreach (array_reverse($config->get('Octo.paths.templates', [])) as $path) {
            self::$loader->addPath($path);
        }

        foreach (array_reverse($config->get('Octo.paths.admin_templates', [])) as $path) {
            self::$loader->addPath($path, 'admin');
        }

        self::$loader->addPath(CMS_PATH . 'Database/Templates/', 'db');

        if (OCTO_CACHE_ENABLED) {
            self::$cache = OCTO_CACHE_PATH;
        } else {
            self::$cache = false;
        }

        self::$twig = new Twig_Environment(self::$loader, [
            'charset' => 'UTF-8',
            'cache' => self::$cache,
            'auto_reload' => true,
            'strict_variables' => false,
        ]);

        $functions = [];
        Event::trigger('TemplateInit', $functions);

        foreach ($functions as $name => $callable) {
            self::addFunction($name, $callable);
        }

        self::$initialised = true;
    }
424497
public function initializeConfigure()
    {
        $config = $this->container->singleton('kernel.config');

        $config->setVariable([
            'root.path' => $this->getRootPath(),
            'env'       => $this->getEnvironment(),
            'debug'     => $this->isDebug(),
            'version'   => AppKernel::VERSION,
        ]);

        $this->registerConfigurationVariable($config);

        if ($this->isDebug()) {
            $this->registerConfiguration($config);
            $debug = $this->getContainer()->singleton('kernel.debug');
            $debug->addConfig($debug->getBar(), $config);
            unset($debug);
        } else {
            $config->load($this->getRootPath() . '/config.cache');
        }
    }
344802
public function init()
	{
		// generic driver initialisation
		parent::init();

		if ($this->memcached === false)
		{
			// do we have the PHP memcached extension available
			if ( ! class_exists('Memcached') )
			{
				throw new \FuelException('Memcached sessions are configured, but your PHP installation doesn\'t have the Memcached extension loaded.');
			}

			// instantiate the memcached object
			$this->memcached = new \Memcached();

			// add the configured servers
			$this->memcached->addServers($this->config['servers']);

			// check if we can connect to the server(s)
			if ($this->memcached->getVersion() === false)
			{
				throw new \FuelException('Memcached sessions are configured, but there is no connection possible. Check your configuration.');
			}
		}
	}
148141
protected function _init() {
		parent::_init();
		$router = $this->_classes['router'];

		if ($this->_config['location']) {
			$location = $router::match($this->_config['location'], $this->_config['request']);
			$this->headers('Location', $location);
		}
	}
674965
public static function init() :void {

		// marker
		Profiler::setMarker('Bundles.init', 'framework');

		// if cache is enabled and in prod load the cache, else parse bundles
		Config::isProd() && Cache::has('Includes') ? self::loadCachedDependencies() : self::loadDependencies();
		
		// now that we have the list of config files, pass them to the config class
		Config::includeBundlesConfigs(self::$_configs);

		// now that we have the list of route files, pass them to the router class
		Router::includeBundlesRoutes(self::$_routes);

		// marker
		Profiler::releaseMarker('Bundles.init');

	}
1018295
public function init()
    {
        if ($this->isCacheEnabled() and file_exists(self::CACHE_LOCATION)) {
            $store = include self::CACHE_LOCATION;
        } else {
            $store        = [];
            $finalList    = [];
            $config       = $this->serviceManager->get('config');
            $dirLocations = (array)$config['pagebuilder']['widgets']['paths'];

            foreach ($dirLocations as $namespace => $dirLocation) {
                $iterator = new \RecursiveIteratorIterator(
                    new \RecursiveDirectoryIterator($dirLocation, \FilesystemIterator::SKIP_DOTS),
                    \RecursiveIteratorIterator::CHILD_FIRST
                );

                /** @var $splFileInfo \SplFileInfo */
                foreach ($iterator as $splFileInfo) {
                    $ext = substr(basename($splFileInfo->getFilename()), -4);
                    if ($splFileInfo->isFile() and $ext == '.php') {
                        $widgetId  = substr(basename($splFileInfo->getFilename()), 0, -4);
                        $className = substr(
                            $namespace . str_replace(
                                '/', "\\", str_replace($dirLocation, '', $splFileInfo->getPathname())
                            ),
                            0, -4
                        );

                        $reflection = new \ReflectionClass($className);

                        if ($reflection->isInstantiable()
                            and $reflection->implementsInterface('PageBuilder\WidgetInterface')
                        ) {
                            $attributes = $reflection->getDefaultProperties();
                            $id         = !empty($attributes['id']) ? preg_replace(
                                '/[^a-z]/i', '',
                                $attributes['id']
                            )
                                : $widgetId;
                            $id         = strtolower($id);
                            $category   = basename(dirname($splFileInfo->getPathname()));

                            $data = [
                                'id'          => $id,
                                'class'       => $className,
                                'category'    => ($category == 'Widget') ? 'General' : $category,
                                'title'       => $attributes['name'] ?: $widgetId,
                                'description' => $attributes['description'] ?: 'No description found',
                                'options'     => $attributes['options'],
                            ];

                            $path          = [$id => $data];
                            $store[0][$id] = $data;
                        } else {
                            continue;
                        }
                    } else {
                        $dirName = $splFileInfo->getFilename();
                        $path    = [$dirName => []];
                    }

                    for ($depth = $iterator->getDepth() - 1; $depth >= 0; $depth--) {
                        $dirName = $iterator->getSubIterator($depth)->current()->getFilename();
                        $path    = [$dirName => $path];
                    }

                    uasort(
                        $path,
                        function ($a, $b) {
                            return strcmp($a['title'], $b['title']);
                        }
                    );

                    $finalList = array_merge_recursive($finalList, $path);
                }
            }

            $store[1] = $finalList;

            if ($this->isCacheEnabled()) {
                $data = '<?php return ' . var_export($store, true) . ' ;';
                file_put_contents(self::CACHE_LOCATION, $data);
            }
        }

        $this->dataStore = $store;
    }
926472
public static function init()
	{
		if(!self::$isInited)
		{
			self::name(Config::get('@.SESSION_NAME', null));
			self::savePath(Config::get('@.SESSION_SAVEPATH', null));
			self::useCookies(Config::get('@.SESSION_USE_COOKIES', null));
			self::cacheExpire(Config::get('@.SESSION_CACHE_EXPIRE', null));
			self::cacheLimiter(Config::get('@.SESSION_CACHE_LIMITER', null));
			self::gcProbability(Config::get('@.SESSION_GC_PROBABILITY', null));
			self::maxLifetime(Config::get('@.SESSION_MAX_LIFETIME', null));
			self::prefix(Config::get('@.SESSION_PREFIX', ''));
			self::cookieDomain(Config::get('@.SESSION_COOKIE_DOMAIN',null));
			$saveHandler = Config::get('@.SESSION_SAVE_HANDLER', 'files');
			self::saveHandler($saveHandler);
			if('user' === $saveHandler)
			{
				self::userSaveHandler(Config::get('@.SESSION_USER_SAVE_HANDLER'));
			}
			self::$isInited = true;
			if(null !== self::$sessionID)
			{
				session_id(self::$sessionID);
			}
			session_start();
			session_write_close();
			return true;
		}
		else
		{
			return false;
		}
	}