示例#1
0
 /**
  * Store the provided resource in the appropriate (named) cache
  *
  * @param string $CacheName name of cache library
  * @param string $CacheKey name of cache entry
  * @param mixed $CacheContents contents of cache entry
  * @param bool $CacheWrite optional, whether or not to perform a disk write after this set. default yes
  * @return mixed cache contents
  */
 public static function Cache($CacheName, $CacheKey, $CacheContents, $CacheWrite = TRUE)
 {
     if (!array_key_exists($CacheName, Gdn_LibraryMap::$_Caches)) {
         return FALSE;
     }
     // Set and save cache data to memory and disk
     Gdn_LibraryMap::$_Caches[$CacheName]['cache'][$CacheKey] = $CacheContents;
     if ($CacheWrite === TRUE) {
         Gdn_LibraryMap::SaveCache($CacheName);
     }
     return $CacheContents;
 }