Returns the temporary folder path that silverstripe should use for its cache files.

@param string $base The base path to use for determining the temporary path
@return string Path to temp
540945
public static function getTempFolder($base)
    {
        $parent = static::getTempParentFolder($base);

        // The actual temp folder is a subfolder of getTempParentFolder(), named by username
        $subfolder = Path::join($parent, static::getTempFolderUsername());

        if (!@file_exists($subfolder)) {
            mkdir($subfolder);
        }

        return $subfolder;
    }
1004117
public function getBasePath() : ?string 
    {
        if ( ! $this->hasBasePath()) {
            $this->setBasePath($this->getDefaultBasePath());
        }
        return $this->basePath;
    }
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;
    }
1019668
public function getPathToTemporaryDirectory()
    {
        if ($this->temporaryDirectory !== null) {
            return $this->temporaryDirectory;
        }

        $this->temporaryDirectory = $this->createTemporaryDirectory($this->temporaryDirectoryBase);

        return $this->temporaryDirectory;
    }
856589
protected static function getTempDir()
    {
        $name = tempnam(sys_get_temp_dir(), 'tmp');
        unlink($name);
        mkdir($name, 0777, true);
        return $name;
    }
242137
public function getMapFilePath()
    {
        return sprintf(
            '%s.php',
            $this->mapBasePath .
            DIRECTORY_SEPARATOR .
            $this->getLang().
            DIRECTORY_SEPARATOR .
            $this->getSystem()
        );
    }
670790
public function getBasePath(): string
	{
		if($this->basePath === null)
		{
			$path = $this->server->get('SCRIPT_NAME');

			$this->basePath = rtrim(str_replace(basename($path), '', $path), '/');
		}

		return $this->basePath;
	}
763885
protected function getCachePathFromWebRoot($subdir = null)
    {
        $cache_dir_from_web_root = $this->getCacheDirFromWebRoot();

        if ($subdir != null) {
            $safe_subdir = basename($subdir);

            $path = sprintf("%s/%s", $cache_dir_from_web_root, $safe_subdir);
        } else {
            $path = $cache_dir_from_web_root;
        }

        // Check if path is valid, e.g. in the cache dir
        return $path;
    }
427939
private URI getNextTemporaryPath() {
    Path basePath = ghfs.getHadoopPath(finalGcsPath);
    Path baseDir = basePath.getParent();
    Path tempPath = new Path(
        baseDir,
        String.format("%s%s.%d.%s",
            TEMPFILE_PREFIX, basePath.getName(), curComponentIndex, UUID.randomUUID().toString()));
    return ghfs.getGcsPath(tempPath);
  }
672340
private function getTmpPath(): string
    {
        $tmpDir = sys_get_temp_dir();
        if (!empty($this->prefix)) {
            $tmpDir .= '/' . $this->prefix;
        }
        $tmpDir .= '/' . $this->id;
        return $tmpDir;
    }
208565
public static function getTemporaryDirectory()
    {
        $check = function ($s) {
            $result = '';
            if (is_string($s) && ($s !== '')) {
                $s = @realpath($s);
                if (($s !== false) && is_dir($s) && is_writable(($s))) {
                    $result = $s;
                }
            }

            return $result;
        };
        $result = '';
        if ($result === '') {
            if (static::$temporaryDirectory !== '') {
                $result = $check(static::$temporaryDirectory);
                if ($result === '') {
                    throw new \Exception('The configured temporary directory is not valid');
                }
            }
        }
        if ($result === '') {
            if (function_exists('sys_get_temp_dir')) {
                $result = $check(@sys_get_temp_dir());
            }
        }
        if ($result === '') {
            if (isset($_ENV) && is_array($_ENV)) {
                foreach (array('TMP', 'TMPDIR', 'TEMP') as $k) {
                    if (isset($_ENV[$k])) {
                        $result = $check($_ENV[$k]);
                        if ($result !== '') {
                            break;
                        }
                    }
                }
            }
        }
        if ($result === '') {
            throw new \Exception('Unable to determine a temporary directory');
        }

        return $result;
    }
667183
protected function getSharedStringTempFilePath($sharedStringIndex)
    {
        $numTempFile = intval($sharedStringIndex / $this->maxNumStringsPerTempFile);
        return $this->tempFolder . '/sharedstrings' . $numTempFile;
    }
1189313
public function getBasePath($scriptName = '')
    {
        $scriptName = $scriptName === ''
            ? $_SERVER['SCRIPT_NAME']
            : $scriptName;

        $output = $this->uri->getScheme() . '://' . $this->uri->getHost();
        $output .= $this->uri->getPort()
            ? ':' . $this->uri->getPort()
            : '';

        return $output . str_replace(basename($scriptName), '', $scriptName);
    }
297085
protected function getPath($name)
    {
        $name = str_replace_first($this->getPackageNamespace(), '', $name);
        $this->checkDestination();
        return base_path() . $this->getDestination() . '/'.str_replace('\\', '/', $name).'.php';
    }
216090
public function base_path($path = null)
    {
        return empty($path) ? $this->path : $this->path . $path;
    }
348878
protected function getTemporaryDirectory()
    {
        $result = $this->temporaryDirectory;
        if ($result === '') {
            $fileHelper = $this->app->make('helper/file');
            $temporaryDirectory = (string) $fileHelper->getTemporaryDirectory();
            if ($temporaryDirectory === '' || !$this->filesystem->isDirectory($temporaryDirectory)) {
                throw new UserMessageException(t('Unable to determine the temporary directory.'));
            }
            $this->temporaryDirectory = $temporaryDirectory;
        }

        return $this->temporaryDirectory;
    }
1057607
public function getTempDirectory()
    {
        if (! is_null($this->configuration->getTempDirectory())) {
            return $this->configuration->getTempDirectory();

        }

        if (is_null($this->cachedTempDirectory)) {
            $this->cachedTempDirectory = $this->findTempDirectory();

        }
        return $this->cachedTempDirectory;
    }