timostamm / pathinfo
An object to manipulate filesystem paths with a fluid interface
Installs: 1 356
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 1
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
Requires (Dev)
- phpunit/phpunit: ^8.5.23 || ^9
This package is auto-updated.
Last update: 2024-12-08 16:59:27 UTC
README
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"