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
502193
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;
    }
347645
public function getCwd()
    {
        $path = $this->wrapper->pwd();

        if ('/' === $path) {
            return new Directory('/');
        }

        return $this->findDirectoryByName($path);
    }
176281
public static function createTempDir()
    {
        do {
			$folder = sys_get_temp_dir().DIRECTORY_SEPARATOR."tmp".mt_rand().DIRECTORY_SEPARATOR;
		} while (file_exists($folder));
		mkdir($folder);
		return $folder;
    }
1170
public function getTempDirectory()
    {
        if (!file_exists($this->tempDirectory)) {
            mkdir($this->tempDirectory, 0777);
            chmod($this->tempDirectory, 0777);
        }

        return $this->tempDirectory;
    }
187577
protected static function tempDirectory()
    {
        $tempDir = eZSys::varDirectory() . '/webdav/tmp';
        if ( !file_exists( $tempDir ) )
        {
            eZDir::mkdir( $tempDir, eZDir::directoryPermission(), true );
        }
        return $tempDir;
    }
511715
public function getStoragePath()
    {
        $path = $this->getOption('storage_path');
        $path = $path ? $path : storage_path().'/administrator_settings/';

        return rtrim($path, '/').'/';
    }
1329722
public function getTempPath()
    {
        if (!isset($this->_tempPath)) {
            $hash = md5(microtime(true));
            $this->_tempPath = "{$this->basePath}/{$this->tempDir}/{$hash}";
        }

        return $this->_tempPath;
    }
1254656
private function checkSystemTemporaryFolder(): string
    {
        $open_basedir  = ini_get('open_basedir');
        $open_basedirs = explode(PATH_SEPARATOR, $open_basedir);
        $sys_temp_dir  = sys_get_temp_dir();

        if ($open_basedir === '' || Str::startsWith($sys_temp_dir, $open_basedirs)) {
            return '';
        }

        $message = I18N::translate('The server’s temporary folder cannot be accessed.');
        $message .= '<br>sys_get_temp_dir() = "' . e($sys_temp_dir) . '"';
        $message .= '<br>ini_get("open_basedir") = "' . e($open_basedir) . '"';

        return $message;
    }
44245
protected String getDirectory() {
        //get the default filepath of the permanet storage file
        String directory = storageConfiguration.getDirectory();

        if(directory == null || directory.isEmpty()) {
            directory = System.getProperty("java.io.tmpdir"); //write them to the tmp directory
        }

        return directory;
    }
1088356
protected function getTmpPath()
        {
            $tmpDir = sys_get_temp_dir();

            if (!empty($this->prefix)) {
                $tmpDir .= DIRECTORY_SEPARATOR . $this->prefix;
            }

            $tmpDir .= DIRECTORY_SEPARATOR . uniqid('run-', true);

            return $tmpDir;
        }
551845
private static function getBasePath()
    {
        if (empty(self::$basePath)) {
            self::$basePath = sprintf('%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, self::BASE_PATH_NAME);
        }
        return self::$basePath;
    }
1170670
public static function GetSystemTmpDir () {
		if (self::$tmpDir === NULL) {
			$tmpDir = sys_get_temp_dir();
			if (strtolower(substr(PHP_OS, 0, 3)) == 'win') {
				// Windows:
				$sysRoot = getenv('SystemRoot');
				// do not store anything directly in C:\Windows, use C\windows\Temp instead
				if (!$tmpDir || $tmpDir === $sysRoot) {
					$tmpDir = !empty($_SERVER['TEMP']) 
						? $_SERVER['TEMP']
						: (!empty($_SERVER['TMP'])
							? $_SERVER['TMP']
							: (!empty($_SERVER['WINDIR'])
								? $_SERVER['WINDIR'] . '/Temp'
								: $sysRoot . '/Temp'
							)
						);
				}
				$tmpDir = str_replace('\\', '/', $tmpDir);
			} else if (!$tmpDir) {
				// Other systems
				$tmpDir = !empty($_SERVER['TMPDIR']) 
					? $_SERVER['TMPDIR']
					: (!empty($_SERVER['TMP'])
						? $_SERVER['TMP']
						: (!empty(ini_get('sys_temp_dir'))
							? ini_get('sys_temp_dir')
							: '/tmp'
						)
					);
			}
			self::$tmpDir = $tmpDir;
		}
		return self::$tmpDir;
	}
856589
protected static function getTempDir()
    {
        $name = tempnam(sys_get_temp_dir(), 'tmp');
        unlink($name);
        mkdir($name, 0777, true);
        return $name;
    }
48543
public function getBaseTmpDir()
    {
        $folders = explode(DIRECTORY_SEPARATOR, $this->getRootDir());
        $foldersCount = count($folders);

        /**
         * Base Path
         */
        $projectDir = '';
        if (true === isset($folders[$foldersCount - 2])) {
            $projectDir = $folders[$foldersCount - 2];
        }

        $tempDirPath = FileUtility::getUserBasedCachedDir(sprintf('%s-%s', $projectDir, $this->getEnvironment()));
        FileUtility::mkdir($tempDirPath);

        return $tempDirPath;
    }
360675
protected function getDumpDirectory()
    {
        $dumpName = $this->getDumpName();
        $databaseHandler = $this->getDatabaseHandler();
        $directory = $this->getBaseDumpDirectory() . '/' . $databaseHandler->getDbName() . '/' . $dumpName . '/';
        if (!file_exists($directory)) {
            mkdir($directory, 0777, true);
        }

        return $directory;
    }
1117355
public static PathImpl getTmpWorkDir()
  {
    String userName = System.getProperty("user.name");
    
    PathImpl path;
    // Windows uses /temp as a work dir
    if (com.caucho.v5.util.CauchoUtil.isWindows()
        && ! CurrentTime.isTest())
      path = VfsOld.lookup("file:/c:/tmp/" + userName);
    else
      path = VfsOld.lookup("file:/tmp/" + userName);
    
    return path;
  }
233892
private function getFolder()
    {
        $pathStr = $this->config[ 'savePath' ];
        if (strrchr($pathStr, '/') != '/') {
            $pathStr .= '/';
        }
        $pathStr .= date('Ymd');
        if (!file_exists($pathStr)) {
            if (!mkdir($pathStr, 0777, true)) {
                return false;
            }
        }

        return $pathStr;
    }