Exemple #1
0
 /**
  *
  * @param string $CacheTag - name of tag for future retrieval
  * @param data $Data		- data to be cached
  * @param boolean $ForceCache [optional] if TRUE, writes cache even when disabled
  * @param boolean $bRaw [optional] if TRUE, writes data exactly as provided instead of prefacing with php leadin
  * @param boolean $syscache [optional]
  * @return none
  */
 public function set($CacheTag, $Data, $ForceCache = false, $bRaw = 0, $syscache = false)
 {
     if ($ForceCache != false || $syscache == false && $this->UserCacheActive || $syscache == true && $this->SystemCacheActive && !e107::getParser()->checkHighlighting()) {
         $cache_file = isset($this) && $this instanceof ecache ? $this->cache_fname($CacheTag, $syscache) : ecache::cache_fname($CacheTag, $syscache);
         file_put_contents($cache_file, $bRaw ? $Data : self::CACHE_PREFIX . $Data);
         @chmod($cache_file, 0755);
         //Cache should not be world-writeable
         @touch($cache_file);
     }
 }