Normalizes the given file path by converting aliases to real paths.

@param string $filePath file path.
@return string real path.
436104
protected function normalizePath($filePath)
    {
        if (($path = \Yii::getPathOfAlias($filePath)) !== false) {
            $filePath = $path;
        }

        return $filePath;
    }
388113
public static String formatFilePath(String filePath) {
        if (filePath == null) {
            return null;
        }
        return normalizePath(filePath.replaceAll("//*", "/").replaceAll("\\*", "\\").replaceAll("/", "\\" + System.getProperty("file.separator")).replaceAll("\\\\", "\\" + System.getProperty("file.separator")), System.getProperty("file.separator").equals("/"));

    }
564242
public static function normalizePath($path)
    {
        $path = rtrim($path, '/');
        $path = rtrim($path, '\\');
        $path .= DIRECTORY_SEPARATOR;
        return $path;
    }
651312
static public function normalizePath($path)
    {
        $path = preg_replace('|/\./|', '/', $path);   // entferne /./
        $path = preg_replace('|^\./|', '', $path);    // entferne ./ am Anfang
        $i = 0;
        while (preg_match('|[^/]+/\.{2}/|', $path) && $i < 10) {
            $path = preg_replace_callback('|([^/]+)(/\.{2}/)|', function($matches){
                return ($matches[1] == '..' ? $matches[0] : '');
            }, $path);
            $i++;
        }
        return $path;
    }
1315709
public function normalize(string $path): string
    {
        [$scheme, $path] = $this->getSchemeAndHierarchy($path);

        $path = $this->normalizePathPart($path);

        return $this->toString($scheme, $path);
    }
10623
private function realpath($path)
    {
        if (substr($path, 0, 1) === '/' || substr($path, 1, 1) === ':') {
            return $path;
        }

        return $this->baseDir . '/' . $path;
    }
904030
protected function realpath(string $path): string
    {
        if ($path === '') {
            return $this->baseDir;
        }

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

        return $this->baseDir . '/' . $path;
    }
347461
public static function normalizeFullPath($path)
    {
        $to = Folder::correctSlashFor($path);
        $from = ($to == '/' ? '\\' : '/');

        return str_replace($from, $to, $path);
    }
26951
public static function normalizePath($path, $endSlash = true)
    {
        $path = rtrim($path, '/') . DIRECTORY_SEPARATOR;
        $path = rtrim($path, DIRECTORY_SEPARATOR);

        $path = $endSlash ? $path . DIRECTORY_SEPARATOR : $path;

        return $path;
    }
266572
public static function getFileName($filePath) {
        $lastIndex = strripos($filePath, DIRECTORY_SEPARATOR);
        $fileName = substr($filePath, $lastIndex + 1);
        return substr($fileName, 0, strripos($fileName, "."));
    }
833143
public function normalizePath($path)
    {
        $realpath = realpath($path);
        if ($realpath) {
            $path = $realpath;
        }

        $path = str_replace('\\', '/', $path);
        $path = rtrim($path, '/');
        if (substr($path, 1, 1) === ':') {
            $path = lcfirst($path);
        }

        return $path;
    }
332506
public static function normalizePath($path)
    {
        if (isset(self::$normalizePath[$path])) {
            return self::$normalizePath[$path];
        }

        $path = \str_replace('\\', '/', $path);
        $path = static::removeFunkyWhiteSpace($path);

        $parts = [];

        foreach (\explode('/', $path) as $part) {
            switch ($part) {
                case '':
                case '.':
                    break;

                case '..':
                    if (empty($parts)) {
                        throw new \LogicException('Path is outside of the defined root, path: [' . $path . ']');
                    }
                    \array_pop($parts);
                    break;

                default:
                    $parts[] = $part;
                    break;
            }
        }

        return self::$normalizePath[$path] = implode('/', $parts);
    }
883593
public static function concatPath($folderPath, $filePath = null)
    {
        if (is_array($folderPath)) {
            $fullPath = '';
            foreach ($folderPath as $path) {
                $fullPath = static::concatPath($fullPath, $path);
            }
            return static::fixPath($fullPath);
        }

        if (empty($filePath)) {
            return static::fixPath($folderPath);
        }
        if (empty($folderPath)) {
            return static::fixPath($filePath);
        }

        if (substr($folderPath, -1) == static::getSeparator() || substr($folderPath, -1) == '/') {
            return static::fixPath($folderPath . $filePath);
        }
        return $folderPath . static::getSeparator() . $filePath;
    }
176076
protected function isAbsolutePath($filePath)
    {
        if ($filePath === null || $filePath === '') {
            return false;
        }
    
        if ($filePath[0] === DIRECTORY_SEPARATOR || preg_match('~\A[A-Z]:(?![^/\\\\])~i', $filePath) > 0) {
            return true;
        }
    
        return false;
    }
25126
static function dirpath( $filepath )
    {
        $filepath = eZDir::cleanPath( $filepath, self::SEPARATOR_UNIX );
        $dirPosition = strrpos( $filepath, '/' );
        if ( $dirPosition !== false )
            return substr( $filepath, 0, $dirPosition );
        return $filepath;
    }
768264
protected static function normalizePath($path)
    {
        if ('/' === substr($path, 0, 1)) {
            $path = static::removePathDotSegments($path);
        }

        $path = static::encodePath(
            static::decodeUrlEncodedChars(
                $path,
                '/[' . static::CHAR_UNRESERVED . ':@&=\+\$,\/;%]/'
            )
        );

        if (strlen($path) > 1 && '/' === substr($path, -1)) {
            $path = substr($path, 0, -1);
        }

        return $path;
    }
465928
public function setFilepath($filepath)
    {
        $this->_path = pathinfo($filepath);

        if (!isset($this->_path['extension']))
            $this->_path['extension'] = null;

        return $this;
    }