Update storage.php

This commit is contained in:
Namhyeon Go 2019-11-15 15:48:59 +09:00 committed by GitHub
parent e8c798235c
commit f882241bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -283,16 +283,20 @@ if(!check_function_exists("remove_storage_file")) {
if(!check_function_exists("remove_storage_files")) {
function remove_storage_files($storage_type, $options=array()) {
$failed = 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);
foreach($filenames as $filename) {
$rm = remove_storage_file($filename, array(
"storage_type" => $storage_type,
"max_age" => $max_age
));
if(!$rm) {
$failed++;
if(!in_array($filename, $excludes)) {
$rm = remove_storage_file($filename, array(
"storage_type" => $storage_type,
"max_age" => $max_age
));
if(!$rm) {
$failed++;
}
}
}