madhankumar / directory-manager
A PHP package for directory and file management
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/madhankumar/directory-manager
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-12-20 07:28:52 UTC
README
A PHP package for manage your directory
Setup
Ensure you have composer installed, then run the following command:
composer require madhankumar/directory-manager
That will fetch the library and its dependencies inside your vendor folder. Then you can add the following to your .php files in order to use the library
require_once __DIR__.'/vendor/autoload.php';
Then you need to use the relevant classes:
use Madhankumar\DirectoryManager\DirectoryManager;
Usage
$directoryManager = new DirectoryManager();
List all folders and files in the given path:
$this->directoryManager->listDirectory("/var/www/html");
The above function list all folders and files in the below format
{
"folders": [ // Array
{
"id": int,
"name": string, // Folder name
"size": int, // Folder size
"created_time": string, // Folder created date timestamp in the format of Y-m-d HH:mm:ss
"modified_time": string, // Folder modified date timestamp in the format of Y-m-d HH:mm:ss
"created_timestamp": int, // timestamp
"modified_timestamp": int, // timestamp
},
...
],
"files": [ // Array
{
"id": int,
"name": string, // File name
"path": string, // File full path
"size": int, // File size
"created_time": string, // Folder created date timestamp in the format of Y-m-d HH:mm:ss
"modified_time": string, // Folder modified date timestamp in the format of Y-m-d HH:mm:ss
"created_timestamp": int, // timestamp
"modified_timestamp": int, // timestamp
},
...
]
}
Author: Madhankumar madhantocontact@gmail.com