public static function toAbsolutePath(string $path, string $base, bool $useIncludePath = false) : string
    {
        if (self::isAbsolutePath($path)) {
            return $path;
        }

        $file = $base . DIRECTORY_SEPARATOR . $path;

        if ($useIncludePath && !file_exists($file)) {
            $includePathFile = stream_resolve_include_path($path);
            if ($includePathFile) {
                $file = $includePathFile;
            }
        }
        return $file;
    }
public static function toAbsolutePath(string $path, string $base, bool $useIncludePath = false) : string
    {
        if (self::isAbsolutePath($path)) {
            return $path;
        }

        $file = $base . DIRECTORY_SEPARATOR . $path;

        if ($useIncludePath && !file_exists($file)) {
            $includePathFile = stream_resolve_include_path($path);
            if ($includePathFile) {
                $file = $includePathFile;
            }
        }
        return $file;
    }
public static function toAbsolutePath ( string $ path , string $ base , bool $ useIncludePath = false ) : string { if ( self :: isAbsolutePath ( $ path ) ) { return $ path ; } $ file = $ base . DIRECTORY_SEPARATOR . $ path ; if ( $ useIncludePath && ! file_exists ( $ file ) ) { $ includePathFile = stream_resolve_include_path ( $ path ) ; if ( $ includePathFile ) { $ file = $ includePathFile ; } } return $ file ; }
Converts a path to an absolute one if necessary relative to a given base path.

@param  string $path
@param  string $base
@param  bool   $useIncludePath
@return string
Converts a path to an absolute one if necessary relative to a given base path .