PHP Class VersionPress\Utils\PathUtils

Datei anzeigen Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method Description
getRelativePath ( string $from, string $to ) : string Calculates relative path from two absolute paths.

Private Methods

Method Description
countCommonDepth ( $from, $to )
realpath ( array $pathFragments ) : array Removes '.' and '.
windowsFix ( string $path ) : string Converts '\' to '/' and makes disk drive (e.g., C:) case insensitive

Method Details

getRelativePath() public static method

Calculates relative path from two absolute paths.
public static getRelativePath ( string $from, string $to ) : string
$from string It has to be a directory!
$to string Directory or file the relative path will lead to.
return string