function Helper::isAbsolutePath

Checks if the $path is absolute or relative (detecting either '/' or 'x:/' as first part of string) and returns TRUE if so.

Parameters

string $path File path to evaluate:

Return value

bool

1 call to Helper::isAbsolutePath()
Helper::getCanonicalPath in misc/typo3/phar-stream-wrapper/src/Helper.php
Resolves all dots, slashes and removes spaces after or before a path...

File

misc/typo3/phar-stream-wrapper/src/Helper.php, line 181

Class

Helper
Helper provides low-level tools on file name resolving. However it does not (and should not) maintain any runtime state information. In order to resolve Phar archive paths according resolvers have to be used.

Namespace

TYPO3\PharStreamWrapper

Code

private static function isAbsolutePath($path) {
    // Path starting with a / is always absolute, on every system
    // On Windows also a path starting with a drive letter is absolute: X:/
    return (isset($path[0]) ? $path[0] : null) === '/' || static::isWindows() && (strpos($path, ':/') === 1 || strpos($path, ':\\') === 1);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.