示例#1
0
 public function Save($Key, &$Data)
 {
     if (is_array($Key)) {
         $Key = implode(DIR_SEP, $Key);
     }
     if (strpos($Key, DIR_SEP) !== false) {
         $Dirs = explode(DIR_SEP, $Key);
         array_pop($Dirs);
         $Current = $this->DefaultFiledir . DIR_SEP;
         foreach ($Dirs as $Dir) {
             $DirPath = $Current . $Dir;
             if (!is_dir($DirPath)) {
                 mkdir($DirPath);
                 chmod($DirPath, 0755);
             }
             $Current = $DirPath . DIR_SEP;
         }
     }
     $File = $this->DefaultFiledir . DIR_SEP . $Key;
     if ($Data === NULL) {
         if (is_dir($File)) {
             rm_recursive($File);
         } else {
             unlink($File);
         }
         return true;
     }
     return RD_Util::Write($File, serialize($Data));
 }
示例#2
0
 protected static function WriteLog($text)
 {
     if (isset(self::$Logfile) && self::$Logfile) {
         return RD_Util::Write(self::$Logfile, $text, true);
     }
     return false;
 }