Turns relative paths in absolute paths without realpath()

Since the dirs might not exist yet we can not call realpath or it will fail.

@param  string $path
@return string
10623
private function realpath($path)
    {
        if (substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':') {
            return $path;
        }

        return $this->baseDir . '/' . $path;
    }
1164392
protected static function _realpath($path)
    {
        $realPath = realpath($path);
        if ($realPath !== false) {
            $path = $realPath;
        }

        return rtrim($path, '/\\');
    }
450363
public static function remove_relative_path($path) {
        $pieces = explode('/', $path);
        $new_pieces = array();
        for($i=0; $i < count($pieces); $i++) {
            if ($pieces[$i] == '.' ) continue;
            if ($pieces[$i] == '..' ) {
                array_pop($new_pieces);
                continue;
            }
            $new_pieces[] = $pieces[$i];
        }
        $retval = implode("/",$new_pieces);
        return $retval;
    }
1333361
private function relativizePaths($path)
    {
        if (!$this->basePath) {
            return $path;
        }

        return str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
    }
798776
public static function fixPath($path)
    {
        // Detect which direction of slash is "wrong"
        switch (DIRECTORY_SEPARATOR) {
            case '\\':
                $wrongDirection = '/';
                break;

            case '/':
            default:
                $wrongDirection = '\\';
                break;
        }

        if (false !== stristr($path, $wrongDirection)) {
            $path = str_replace($wrongDirection, DIRECTORY_SEPARATOR, $path);

            // In case of mixed slashes we maybe need to cleanup
            if (stristr($path, '\\\\')) {
                $path = str_replace('\\\\', '\\', $path);
            } elseif (stristr($path, '//')) {
                $path = str_replace('//', '/', $path);
            }
        }

        // Return corrected path
        return $path;
    }
1081072
protected function findRelativePath($path)
    {
        if (null !== $this->basePath) {
            return strtr($path, array($this->basePath . DIRECTORY_SEPARATOR => ''));
        }

        return $path;
    }
913056
public function move($path)
    {
        if($this->isDirectory()){
            return false;
        }
        $path = $this->relativeToAbsolute($path);
        if (($ret = @rename($this->filePath, $path)) === true) {
            $this->filePath = $path;
        }

        return $ret;
    }
875965
public function setRelativeAssetsPath($path) {

	    $path = trim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');

	    if($path) {
	        $path .= '/';
        }

		$this->relativeAssetsPath =  $path;
		return $this;

	}
895422
public function getRelativeProjectPath(string $path): string
    {
        $realPath = $this->getAbsolutePath($path);
        $gitPath = $this->getAbsolutePath($this->getGitDir());

        if (0 !== strpos($realPath, $gitPath)) {
            return $realPath;
        }

        return rtrim($this->getRelativePath($realPath), '\\/');
    }
844823
protected function refinePath($path)
    {
        $path = str_replace(array('/', "\\"), DIRECTORY_SEPARATOR, $path);

        list($path) = explode('?', $path);

        return $path;
    }
1155469
public function basePath($path = null)
    {
        if (isset($this->basePath)) {
            return $this->basePath.($path ? '/'.$path : $path);
        }

        if ($this->runningInConsole()) {
            $this->basePath = getcwd();
        } else {
            $this->basePath = realpath(getcwd().'/../');
        }

        return $this->basePath($path);
    }
227271
protected function relativeTargetPath($path)
    {
        if (strpos($path, JPATH_ROOT) === 0) {
            $path = self::$resourceLocator->rewrite(
                $this->relativeJoomlaTargetPath($path),
                true
            );
        }

        return $path;
    }
924588
protected function realpath($path)
    {
        if ($path === '') {
            return $this->baseDir;
        }

        if ($path[0] === '/' || $path[1] === ':') {
            return $path;
        }

        return $this->baseDir . '/' . $path;
    }
521132
public static function relative($path)
    {
        // windows fix :/
        $path = str_replace('\\', '/', $path);

        // standard working directory
        if (strpos($path, WWW_DIR) !== false) {
            return str_replace(WWW_DIR, '', $path);
        }

        // symlink
        $pos = strpos($path, 'upload/');

        return substr($path, $pos - 1);
    }
298983
public function normalizePath($path)
	{
		$path = rtrim($path, '/\\').DIRECTORY_SEPARATOR;
		$path = realpath($path).DIRECTORY_SEPARATOR;

		if ($this->root and strpos($path, $this->root) !== 0)
		{
			throw new \Exception('Cannot access path outside: '.$this->root.'. Trying to access: '.$path);
		}

		return $path;
	}
981229
protected function getAbsolutePath($relativePath)
    {
        return rtrim($this->path, DIRECTORY_SEPARATOR)
             . DIRECTORY_SEPARATOR
             . ltrim($relativePath, DIRECTORY_SEPARATOR);
    }
389216
protected function cleanPathInternal($path)
    {
        if ($this->isVirtual($path)) {
            return $this->cleanPath($path);
        }

        if ($this->hasCDBack($path)) {
            $realpath = $this->cleanPath(realpath($path));
            return $realpath ?: null;
        }

        return $this->cleanPath($path);
    }