public function __construct($cacheKey, array $configuration, array $htmlCacheOptions)
 {
     parent::__construct($cacheKey, $configuration, $htmlCacheOptions);
     $this->memcached = \StaticHtmlMemcachedResponse::getConnection($configuration, $htmlCacheOptions);
     if ($this->memcached !== null) {
         $this->memcached->setCompressThreshold(0);
     }
     $this->compression = !isset($htmlCacheOptions["MEMCACHE_COMPRESSION"]) || $htmlCacheOptions["MEMCACHE_COMPRESSION"] !== "N";
 }
Example #2
0
 /**
  * Writes a debug information in a log file
  */
 private function writeDebug()
 {
     if (!$this->debugEnabled || !defined("BX_COMPOSITE_DEBUG") || BX_COMPOSITE_DEBUG !== true || !$this->storage->exists()) {
         return;
     }
     if (!$this->storage->shouldCountQuota() || \CHTMLPagesCache::checkQuota()) {
         //temporary check
         if ($this->storage instanceof StaticHtmlFileStorage) {
             $cacheFile = $this->storage->getCacheFile();
             $backupName = $cacheFile->getPath() . ".delete." . microtime(true);
             AddMessage2Log($backupName, "composite");
             $backupFile = new Main\IO\File($backupName);
             $backupFile->putContents($cacheFile->getContents());
             \CHTMLPagesCache::writeStatistic(0, 0, 0, 0, $cacheFile->getSize());
         } else {
             AddMessage2Log($this->cacheKey . " was deleted", "composite");
         }
     } else {
         AddMessage2Log($this->cacheKey . "(quota exceeded)", "composite");
     }
 }
 public function __construct($cacheKey, array $configuration, array $htmlCacheOptions)
 {
     parent::__construct($cacheKey, $configuration, $htmlCacheOptions);
     $this->cacheFile = new Main\IO\File(Main\IO\Path::convertRelativeToAbsolute(Main\Application::getPersonalRoot() . "/html_pages" . $this->cacheKey));
 }