HumHub Documentation (unofficial)

PathResolver
in package

Table of Contents

Methods

getRelativeDir()  : string
Returns path to a given directory relative to $projDir.
isPathAbsolute()  : mixed
fsCaseStrCmp()  : int
FileSystem Case String Compare compare two strings with the filesystem's case-sensitiveness
getPathAbsolutenessPrefix()  : string
What part of this path (leftmost 0-3 characters) what it is absolute relative to:
isWindows()  : bool
Are we in a Windows style filesystem?

Methods

getRelativeDir()

Returns path to a given directory relative to $projDir.

public static getRelativeDir(string $path, string $projDir[, string $dirSep = DIRECTORY_SEPARATOR ]) : string
Parameters
$path : string
$projDir : string
$dirSep : string = DIRECTORY_SEPARATOR
Return values
string

isPathAbsolute()

public static isPathAbsolute(mixed $path) : mixed
Parameters
$path : mixed

fsCaseStrCmp()

FileSystem Case String Compare compare two strings with the filesystem's case-sensitiveness

private static fsCaseStrCmp(string $str1, string $str2[, string $dirSep = DIRECTORY_SEPARATOR ]) : int
Parameters
$str1 : string
$str2 : string
$dirSep : string = DIRECTORY_SEPARATOR
Return values
int

-1 / 0 / 1 for < / = / > respectively

getPathAbsolutenessPrefix()

What part of this path (leftmost 0-3 characters) what it is absolute relative to:

private static getPathAbsolutenessPrefix(string $path[, string $dirSep = DIRECTORY_SEPARATOR ]) : string

On Unix: This is simply '/' for an absolute path or '' for a relative path

On Windows this is more complicated: If the first two characters are a letter followed by a ':', this indicates that the path is on a specific device. With or without a device specified, a path MAY start with a '\' to indicate an absolute path on the device or '' to indicate a path relative to the device's CWD

Parameters
$path : string
$dirSep : string = DIRECTORY_SEPARATOR
Return values
string

isWindows()

Are we in a Windows style filesystem?

private static isWindows([string $dirSep = DIRECTORY_SEPARATOR ]) : bool
Parameters
$dirSep : string = DIRECTORY_SEPARATOR
Return values
bool

        
On this page

Search results