timostamm / pathinfo

A PHP object to manipulate filesystem paths with a fluid interface.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP Pathinfo

build Packagist PHP Version GitHub tag License

An object to manipulate filesystem paths with a fluid interface.

Example

$root = Path::info('/var/wwwroot/index.html');

$root->equals('/foo/../var/root/index.html'); // -> true
$root->isIn('/var/wwwroot/'); // -> true
$root->isAbsolute(); // -> true

$root->dirname(); // -> "/var/wwwroot/"
$root->filename(); // -> "index.html"
$root->basename(); // -> "index"
$root->extension(); // -> "html"

Path::info('../log.txt')
	->abs($root)
	->get(); // -> "/var/log.txt"

Path::info('/foo/../var/root/index.html')
	->normalize()
	->get(); // -> "/var/wwwroot/index.html"

About

A PHP object to manipulate filesystem paths with a fluid interface.

License:GNU Affero General Public License v3.0


Languages

Language:PHP 75.7%Language:Puppet 24.2%Language:Pascal 0.1%