示例#1
0
 /**
  * Returns the temporary directory.
  *
  * Uses the PHP 5.2.1 function sys_get_temp_dir().
  *
  * Note that the directory name returned will have a "slash" at the end
  * ("/" for Linux and "\" for Windows).
  *
  * @return string
  */
 public static function getTmpDir()
 {
     if (self::$tmpDir === null) {
         self::$tmpDir = sys_get_temp_dir();
         if (substr(self::$tmpDir, strlen(self::$tmpDir) - 1) !== DIRECTORY_SEPARATOR) {
             self::$tmpDir = self::$tmpDir . DIRECTORY_SEPARATOR;
         }
     }
     return self::$tmpDir;
 }