sagnikrivud/php-folderaspire

Create dynamic folder at storage or any location

v2.0.1 2024-02-19 09:48 UTC

This package is not auto-updated.

Last update: 2025-04-01 09:30:04 UTC


README

Automating folder generation in PHP can be done using the mkdir() function, which is used to create directories. Here's a brief example of how you can automatically generate folders:

  • Custom PHP
  • Wordpress
  • Laravel (10.0 or Higher)

Versions and compatibility

Status

NoteUnder Development

Installation

Please follow this steps, and also refer the code blocks for ths setup using php dependency manager (composer). Open terminal and run this command, but this is need to remember that the user file or folder write permission should be given under same group, like user: sudo and group: www-data

in composer.json under require you can directly write "sagnikrivud/php-folderaspire" under require and run:

$ composer install

OR

You can directly run from terminal

$ composer require sagnikrivud/php-folderaspire

Use the Service Provider class at PHP file after auto loading configuration:

require __DIR__ . '/vendor/autoload.php';
use  Sagnikd\FolderAspire\Classes\Folder;
$manageFolder = new Folder();

create a folder with permission

$manageFolder->createDirectory('path/to/directory_name', 775); //Return true/false

Import directory from an existing parent directory

$manageFolder->importDirectory('source/dir','destination/dir');

Get proper location or Path of a Folder or File

$manageFolder->getFolderLocation('folderName/fileName'); //Return "/FolderAspire/Config/Label.php"

Get a Namespace of Class or Service provider

$manageFolder->recoverNamespace(null,'path/to/class_file'); //Return "App\Http\Controllers"

Lock a directory

$manageFolder->lockDirectory('folder', 'path/to/folder'); //Return true/false

Remove folder or File

$manageFolder->removeFileOrDirectory('patha/to/file_or_direcory_name'); // Return true/false

Base/root directory

'Base' => env('BASE_ROOT', __DIR__),

💻 Tech Stack

CSS3 PHP HTML5 JavaScript AWS Vue.js Vuetify NPM jQuery Express.js Laravel NuxtJS Socket.io Apache MariaDB MongoDB MySQL SQLite Inkscape Jira Vagrant Shell Cakephp Arduino C++ MsSQLServer CodeIgniter Lumen Node.js