Update storage.php
This commit is contained in:
parent
e8c798235c
commit
f882241bce
|
@ -283,16 +283,20 @@ if(!check_function_exists("remove_storage_file")) {
|
||||||
if(!check_function_exists("remove_storage_files")) {
|
if(!check_function_exists("remove_storage_files")) {
|
||||||
function remove_storage_files($storage_type, $options=array()) {
|
function remove_storage_files($storage_type, $options=array()) {
|
||||||
$failed = 0;
|
$failed = 0;
|
||||||
|
|
||||||
$max_age = intval(get_value_in_array("max_age", $options, 0));
|
$max_age = intval(get_value_in_array("max_age", $options, 0));
|
||||||
|
$excludes = get_array(get_value_in_array("excludes", $options, array()));
|
||||||
|
|
||||||
$filenames = iterate_storage_files($storage_type);
|
$filenames = iterate_storage_files($storage_type);
|
||||||
foreach($filenames as $filename) {
|
foreach($filenames as $filename) {
|
||||||
$rm = remove_storage_file($filename, array(
|
if(!in_array($filename, $excludes)) {
|
||||||
"storage_type" => $storage_type,
|
$rm = remove_storage_file($filename, array(
|
||||||
"max_age" => $max_age
|
"storage_type" => $storage_type,
|
||||||
));
|
"max_age" => $max_age
|
||||||
if(!$rm) {
|
));
|
||||||
$failed++;
|
if(!$rm) {
|
||||||
|
$failed++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user