Ejemplo n.º 1
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");
     }
 }