public static function normalize($path, $prependDrive = true)
    {
        $path = self::join((string) $path);

        if ($prependDrive && $path[0] === DIRECTORY_SEPARATOR) {
            return strstr(getcwd(), DIRECTORY_SEPARATOR, true) . $path;
        }

        return $path;
    }
public static function normalize($path, $prependDrive = true)
    {
        $path = self::join((string) $path);

        if ($prependDrive && $path[0] === DIRECTORY_SEPARATOR) {
            return strstr(getcwd(), DIRECTORY_SEPARATOR, true) . $path;
        }

        return $path;
    }
public static function normalize ( $ path , $ prependDrive = true ) { $ path = self :: join ( ( string ) $ path ) ; if ( $ prependDrive && $ path [ 0 ] === DIRECTORY_SEPARATOR ) { return strstr ( getcwd ( ) , DIRECTORY_SEPARATOR , true ) . $ path ; } return $ path ; }
Normalizes the provided file system path.

Normalizing file system paths means that all forward and backward
slashes in the path will be replaced with the system directory separator
and multiple directory separators will be condensed into one.
Additionally, all `.` and `..` directory references will be resolved in
the returned path.

Note that if the normalized path is not an absolute path, the resulting
path may begin with `..` directory references if it is not possible to
resolve them simply by using string handling. You should also note that
if the resulting path would result in an empty string, this method will
return `.` instead.

If the `$prependDrive` option is enabled, the normalized path will be
prepended with the drive name on Windows platforms using the current
working directory, if the path is an absolute path that does not include
a drive name.

@param string $path File system path to normalize
@param bool $prependDrive True to prepend drive name to absolute paths
@return string The normalizes file system path
Normalizes the provided file system path .