PHPFileSystem is an easy script for manage the real filesystem in the server.
Simple and minimalist interface
Simply add the files IShellCommands.php
and FileSystem.php
in your project.
include('FileSystem\IShellCommands.php');
include('FileSystem\Shell.php');
And run this as
$filesystem = new \Pleets\FileSystem\Shell();
To create directories
$filesystem ->mkdir('myDir');
To create files
$filesystem ->touch('myFile.ext');
To delete directories
$filesystem ->rmdir('myDir');
To delete files
$filesystem ->rm('myFile.ext');
To move directories
$filesystem ->mv('myDir', 'myPath');
To move files
$filesystem ->mv('myFile.ext', 'myPath');
This command is same in Linux, the mv
command also is useful to rename files an directories.
To list files and dirs
$filesystem ->ls();
To list files and dirs recursively
$filesystem ->ls('path', true);
$filesystem ->cd('myPath');