示例#1
0
 private function initCache()
 {
     // Кеширование. Инициализация.
     $cache = new _Core_Cache(false, CACHE_ENABLED);
     // Файловый кеш
     if (CACHE_ENABLED) {
         $cache->addBackend(new _Core_Cache_Backend_Files(CACHE_FILES_DIR));
     }
     // Memcached кеш
     if (CACHE_ENABLED && MEMCACHE_ENABLED) {
         $cache->addBackend(new _Core_Cache_Backend_Memcache(MEMCACHE_HOST, MEMCACHE_PORT));
     }
 }
示例#2
0
 public function __construct($keyPrefix = false, $enabled = true)
 {
     self::$instance = $this;
     $this->enabled = (bool) $enabled;
     $this->keyPrefix = $keyPrefix;
 }