patternseek / recycle
A utility library implementing a recycle/trash bin for scripts to more safely recursively delete directories.
Installs: 228
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/patternseek/recycle
Requires
- webmozart/path-util: ^2.0
Requires (Dev)
- phpunit/phpunit: 4.0.*
This package is auto-updated.
Last update: 2025-09-22 15:10:09 UTC
README
A utility library implementing a recycle/trash bin for scripts to recursively 'delete' directories more safely.
Usage example
// Recycle will attempt to create the directory, but not its parent. $r = new Recycle( "/tmp/my_apps_recycle_bin/" ); // moveToBin tells you the new filepath/name for the moved // file or directory. This is mostly useful for testing. $movedTo = $r->moveToBin("/var/tmp/somefile_or_dir"); // Remove entries before last midnight $r->emptyBin( $daysToKeep = 1 );