@since Method available since Release 3.5.0
string $path:
boolean $useIncludePath:
string
protected function toAbsolutePath($path, $useIncludePath = FALSE) {
// Check whether the path is already absolute.
if ($path[0] === '/' || $path[0] === '\\' || strlen($path) > 3 && ctype_alpha($path[0]) && $path[1] === ':' && ($path[2] === '\\' || $path[2] === '/')) {
return $path;
}
// Check whether a stream is used.
if (strpos($path, '://') !== FALSE) {
return $path;
}
$file = dirname($this->filename) . DIRECTORY_SEPARATOR . $path;
if ($useIncludePath && !file_exists($file)) {
$includePathFile = stream_resolve_include_path($path);
if ($includePathFile) {
$file = $includePathFile;
}
}
return $file;
}