/** * constructor */ function __construct(&$subject, $config) { global $_PROFILER; $mainframe = JFactory::getApplication(); parent::__construct($subject, $config); // if page cache is enabled. if ($this->params->get('enable_cache', 0)) { //Set the language in the class $config =& JFactory::getConfig(); $options = array('cachebase' => JPATH_BASE . DS . 'cache', 'defaultgroup' => 'page', 'lifetime' => $this->params->get('cachetime', 15) * 60, 'enable_cache' => $this->params->get('enable_cache', 1) ? true : false, 'caching' => false, 'language' => $config->getValue('config.language', 'en-GB')); file_put_contents(JPATH_BASE . DS . 'cache' . DS . 'time.txt', $this->params->get('cachetime', 15) * 60); jimport('joomla.cache.cache'); $this->_cache = JCache::getInstance('page', $options); $menu = $this->params->get('menu', ''); if ($menu != '') { $this->_ItemidsCached = !is_array($menu) ? array($menu) : $menu; } } // process clear cache from client request if (JRequest::getVar('icespeed')) { $this->processClearCacheRequest(); } if ($mainframe->isAdmin()) { // load js and css for proccessing client action. PlgIceSpeedHelper::loadAdminMediaFiles('ice_speed'); // trigger clear cache: automatic clear cache after saved, applied. if (JRequest::getVar('task') == 'apply' || JRequest::getVar('task') == 'save') { $this->processClearCacheRequest(); } } }