public function indexAction() { $this->disableRenderView(); $cache = Z_Cache::getInstance(); $cache->clean('all'); Z_FlashMessenger::addMessage('Кэш очищен'); }
public function routeShutdown(Zend_Controller_Request_Abstract $request) { if ($this->getRequest()->getModuleName() == 'admin') { return; } $uri = $request->getRequestUri(); if (!($titles = Z_Cache::getInstance()->load('z_titles'))) { $table_titles = new Z_Model_Titles(); $titles = $table_titles->fetchAll(NULL, 'orderid asc'); Z_Cache::getInstance()->save($titles, 'z_titles'); } foreach ($titles as $title) { if (strpos($uri, $title->uri) === 0) { if ($title->title_block) { Z_Seo::addTitle($title->title); } else { Z_Seo::setTitle($title->title); } if ($title->description_block) { Z_Seo::addDescription($title->description); } else { Z_Seo::setDescription($title->description); } if ($title->keywords_block) { Z_Seo::addKeywords($title->keywords); } else { Z_Seo::setKeywords($title->keywords); } } } }
public function __construct() { $cache = Z_Cache::getInstance(); if (!($this->currency = $cache->load('z_currency_data'))) { $this->currency = $this->_getCurrencyArray(); $cache->save($this->currency, 'z_currency_data', '', 86400); } }
public function __construct($sid) { self::$_model = new Z_Model_Statpage(); $cache = Z_Cache::getInstance(); if (!($this->_row = $cache->load('z_spatpage_' . md5($sid)))) { $this->_row = $this->_getRow($sid); $cache->save($this->_row, 'z_spatpage_' . md5($sid)); } }
/** * @return Z_Acl */ public static function getInstance() { if (null === self::$_instance) { $cache = Z_Cache::getInstance(); if (!($acl = $cache->load('z_acl'))) { $acl = new Z_Acl(); $cache->save($acl, 'z_acl'); } self::$_instance = $acl; } return self::$_instance; }
/** * @return Zend_Db_Table_Row */ protected function _getRow($sid) { $cache = Z_Cache::getInstance(); if (!($this->_data = $cache->load('kap_config'))) { $this->_data = $this->_model->fetchPairs(array('sid', 'value')); $cache->save($this->_data, 'kap_config'); } if (isset($this->_data[$sid])) { return $this->_data[$sid]; } else { return false; } }