|
RelPath
Work with file paths to join or find the relative path
|
Utilities for computing a relative filepath between two paths. More...
Static Public Member Functions | |
| static | getRelativePath (string $path, ?string $start=null) |
| Return a relative filepath to $path, either from the current directory or from an optional start directory. | |
| static | joinPath (string $base, string $path) |
| Join two path components. | |
Utilities for computing a relative filepath between two paths.
|
static |
Return a relative filepath to $path, either from the current directory or from an optional start directory.
Both paths must be absolute.
| string | $path | File path. |
| string | null | $start | Start directory. Optional; if not specified, the current working directory will be used. |
|
static |
Join two path components.
This can be used to expand a path relative to a given base path. The given path may also be absolute, in which case it is returned directly.
This function is similar to os.path.join() in Python, and path.join() in Node.js.
| string | $base | Base path. |
| string | $path | File $path to join to $base path. |