Skip to content

Recycle/trash bin implementation for PHP scripts that need to recursively delete with some additional safety.

License

Notifications You must be signed in to change notification settings

patternseek/recycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recycle

Scrutinizer Code Quality SensioLabsInsight

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 );

About

Recycle/trash bin implementation for PHP scripts that need to recursively delete with some additional safety.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages