dev-master
9999999-dev https://github.com/Clavelinho/shredPhpSafely deletes files
MIT
The Requires
- php >=5.3.0
by Dani C.
delete secure remove shred
Wallogit.com
2017 © Pedro Peláez
Safely deletes files
Safely deletes files v0.5b, (*1)
PHP 5.3, (*2)
composer.json, (*3)
{
"require": {
"clavelinho/shred": "dev-master"
}
}
Run composer install, (*4)
// load autoload composer
require 'vendor/autoload.php';
$shred = new Shred\Shred($n); // $n (optional) <= Number of iterations. Default 3.
$shred->remove('folder/file.txt'); // <= Overwrite and Remove.
$shred->remove('folder/file.txt', false); // <= Only overwrite.
// Check if remove
if ($shred->remove('folder/file.txt')) {
// The file is truncated & removed.
} else {
// Impossible to overwrite or remove the file. See filepath & file permissions.
}
Shred overwrite 'n' times the file for make more difficult to recovery (Imposible is nothing!). Obviously inspired in shred for linux. If you want to delete large files, or repeat a large number of times the interaction should increase the execution time of the script., (*5)
ini_get('max_execution_time'); // Max execution script time in seconds.
set_time_limit($s); // $s => Set max time limit in seconds.
Shred PHP was created by Dani C. Released under the MIT license., (*6)
Safely deletes files
MIT
delete secure remove shred