Download the PHP package weevers/path without Composer
On this page you can find all versions of the php package weevers/path. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package path
path
PHP 5.4 port of the node/iojs path module, because PHP is like a family holiday dinner and I want to survive. Description from the iojs documentation:
This module contains utilities for handling and transforming file paths. Almost all these methods perform only string transformations. The file system is not consulted to check whether paths are valid.
Jump to: license
examples
Example output on a posix system, assuming "/please" is the current working directory:
usage
Usage docs pending. In the meantime, consult the iojs documentation, because the function signatures are almost the same and the code (including unit tests) copied.
Ported so far (for posix and windows), including unit tests
relative($from, $to)
isAbsolute($path)
resolve($path, ..)
join($path, ..)
normalize($path)
separator()
delimiter()
PHP-specific additions
resolve()
also accepts stream wrapper URI's. This is implemented outside of the (ported) posix and Windows adapters, to ensure it doesn't interfere with the original behavior (which remains well tested and has a frozen stability).
file
schemes are stripped, unless combined with other schemes- A scheme change is interpreted like a root change. E.g. going from
http://x
toglob://x
acts like acd
fromc:\x
tod:\x
. - For remote streams (like
http
) and vfs streams, the arguments passed toresolve()
are joined (instead of resolved to an absolute path) with forward slashes (regardless of OS).
Some examples (for Windows, so you can see the difference between local and remote streams), assuming "C:\project" is the current working directory:
Additional methods
isInside($path, $parent)
- similar to sindresorhus/is-path-inside for nodegetPrefix($path)
- returns "zip://" for "zip://2015.zip#april/02.log"
install
With composer do:
license
MIT © Vincent Weevers and iojs/node authors.