/** * Register the custom PHP ESI parser * * @return void */ public function enableEsi() { $options = $this->getOptions(); if (isset($options['headerName'])) { Glitch_View_Helper_Esi::setHeader($options['headerName'], 1); } // Ensure the front controller is initialized $this->_bootstrap->bootstrap('FrontController'); $front = $this->_bootstrap->getResource('FrontController'); if (isset($options['phpParser']) && true === (bool) $options['phpParser']) { // Get the cache using the config settings as input $this->_bootstrap->bootstrap('CacheManager'); $manager = $this->_bootstrap->getResource('CacheManager'); if ($manager->hasCache('esi')) { $cache = $manager->getCache('esi'); Glitch_Controller_Plugin_EsiParser::setCache($cache); } // push the profiler on the plugin stack to time the dispatch process $front->registerPlugin(new Glitch_Controller_Plugin_EsiParser()); } }
/** * Enables/Disables the cache for this instance * * @param bool $enable * @return void */ public static function setCacheEnabled($enable) { self::$_cacheEnabled = (bool) $enable; }