Exemple #1
0
 /**
  * Create the cache and cachePrefix to be used by this collection
  **/
 public function __construct(array $items = array(), array $orderMembers = array(), $backend = 'Apc', array $backendOptions = array())
 {
     //increment the cacheId so the next collection_cache gets a different prefix
     $this->cachePrefix = 'Collection' . self::$_cacheId++ . '_';
     $this->cache = \Zend\Cache::factory('Core', $backend, array('automatic_serialization' => true), $backendOptions);
     //items array is not used in the Collection_Cache object
     unset($this->_items);
     parent::__construct($items, $orderMembers);
 }
 function __construct()
 {
     $this->open_connection();
     $this->magic_quotes_active = get_magic_quotes_gpc();
     $this->real_escape_string_exists = function_exists("mysql_real_escape_string");
     // $this->cache = new Memcache();
     // $this->cache->connect(CACHE_SERVER, CACHE_PORT) or die ("Could not connect");
     $this->zend_cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 3600 * 24, 'automatic_serialization' => true), array('cache_dir' => SITE_ROOT . '/cache_files'));
     Zend_Registry::set('cached', $this->zend_cache);
     //<---set a registry refference
     $this->zend_cache = Zend_Registry::get('cached');
     //<---gets the a registry refference
 }