labcake/path

A class made in PHP7 inspired by nodes path module, for modify and create path strings, also read folder/file information.

dev-master 2018-05-28 17:36 UTC

This package is not auto-updated.

Last update: 2024-04-14 03:02:01 UTC


README

A class made in PHP inspired by nodes path module, for modify and create path strings, also read folder/file information

Resolve path

// This will return a path to /hello/world
Path::resolve("hello", "world");

Basename

Path::basename("test.php");

Dirname

Path::dirname("/var/www/test.php");

Extension name

Path::extname("test.php");

Parse

Path::parse("test.php");

Exists

Path::exists("test.php");

Create directory

// This will create all the folders needed untill the last one is created
Path::mkdir("/this/is/a/path/to/create");

Remove directory

// This will remove all the subfolders and files in the selected path recursively
Path::rmdir("/remove/this/folder");

Documentation not yet complete