A Quick Tutorial - machitgarha/pusheh GitHub Wiki

Using Pusheh is really easy. Read this simple tutorial to get familiar with it.

Ready? First, let us create a directory:

use MAChitgarha\Component\Pusheh;

Pusheh::createDir(__DIR__ . "/src");

You can create nested directories, which means that the directories will be created one by one to until reaching the last directory:

Pusheh::createDirRecursive(__DIR__ . "/lib/cache/app");

Do want to clear a directory, but keep the directory itself?

Pusheh::clearDir("/tmp");

You can also remove a directory:

// Removing an empty directory
Pusheh::removeDir("config");

// Removing a directory with all of its contents, i.e. a non-empty directory
Pusheh::removeDirRecursive(__DIR__ . "bin");

CAUTION: Use the latest methods (e.g. Pusheh::removeDirRecursive()) at your own risk. The operation cannot be undone. Be careful.