Utilities for handling and transforming file paths.
The file system is not checked to verify whether paths are valid.
path lives on packagist.org
$ composer require donut/path
<?php require "vendor/autoload.php";
use \Donut\Path as p;
$path = p\join("/usr/local", "bin", "/donut");
// /usr/local/bin/donutstring canonicalize( string $path [, string $root = getcwd() ] )
<?php
chdir("/home/donut");
canonicalize("a/b/c.ext");
// => /home/donut/a/b/c.ext
canonicalize("a/b/c.ext", "/root");
// => /root/a/b/c.ext
canonicalize("/home/donut/club.ext", "/root");
// => /home/donut/club.extbool is_absolute( string $path )
<?php is_absolute("/home/donut");
// => truestring normalize( string $path )
<?php normalize("/a/b/../c/./d.ext");
// => /a/c/d.extstring join( string $part1 [, string $...] )
<?php join("/usr", "local", "/bin", "./donut");
// => /usr/local/bin/donut- duchess [email protected]
- Donut® Club http://github.com/donutclub
BSD 3-Clause