Bài đăng

Đang hiển thị bài đăng từ Tháng 6, 2015

Session memcached cho Zend 1

Session memcached cho Zend 1 File: application/Bootstrap.php <?php class Bootstrap extends Zend_Application_Bootstrap_Bootstrap  { ... protected function _initSessionId()     {     $this->bootstrap('session');         Zend_Session::getSaveHandler()->setCache(My_Memcache::getSessionCache());     } ... } File: /library/My/Memcache.php <?php class My_Memcache{     private static $_ssinstance;   public static function getSessionCache() {         if(!is_object(self::$_ssinstance))         {             $cacheConf = new Zend_Config_Ini(CONFIG_PATH . '/cache.ini', APPLICATION_ENV);              $memcache = $cacheConf->memcached;             self::$_ssinstance = Zend_Cache::factory($memcache->frontend->name,                                             $memcache->backend->name,                                              $memcache->frontend->options->toArray(),                                             $memc