Download the PHP package rohits/laravel-dir-cleanup without Composer
On this page you can find all versions of the php package rohits/laravel-dir-cleanup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-dir-cleanup
laravel-dir-cleanup
Simple package to delete unwanted files from list of directories.
Installation :
Composer :
composer require rohits/laravel-dir-cleanup
Usage :
Register service provider :
Open your app.config file and add following Line.
Publish config File :
php artisan vendor publish
- choose appropriate provider here its
Rohits\Src\CleanUpserviceProvider
& it should publish a file namedcleanup.php
under your config directory.
Update config file :
- root : Root folder under which you want to delete the files.
- directories : Specify the list of directories you want the package to iterate to delete files.
- level : Specify the depth of directory to iterate. By default all subdirectories will iterated till the last leaf node.
- extensions : Specify the extension to match for deleting files eg. csv Simply specify extension (eg. txt) without prefix (.)
- log : Specify if you want to log the files deleted. This is intentionally kept disabled as you need to specify the directory of log file rather the flooding the default one.
- logDirectory : Name of the directory you want to keep the logs.
- logFileName : Name of the log file if any. By default a file with name cleanup_log.txt will be used.
Configure the cleanup :
-
The package ships with the command that help you schedule it when you want to run the cleanup. Just schedule the command as you would do a normal command.
- You can also manually run the cleanup CRON.
(Note : Please make sure you run php artisan config:clear
before you run the command.)
Tests :
Make sure php is in your path and simply run below command.
vendor/bin/phpunit
Issues:
Please report them @ [email protected]
License :
The MIT License.