use unlink() to delete js files in cache, because rm can fail for a large number of files

This commit is contained in:
Uwe Steinmann 2024-09-18 09:23:15 +02:00
parent fdf91ac3a2
commit 5d083993df

View File

@ -45,8 +45,8 @@ class SeedDMS_Controller_ClearCache extends SeedDMS_Controller_Common {
}
if(!empty($post['js'])) {
$cmd = 'rm -rf '.addDirSep($settings->_cacheDir).'js'.DIRECTORY_SEPARATOR.'*';
system($cmd, $ret);
/* system('rm ...') does not work anymore if the number of files is too large */
array_map('unlink', array_filter((array) glob(addDirSep($settings->_cacheDir).'js'.DIRECTORY_SEPARATOR.'*')));
}
if(false === $this->callHook('clear', $post)) {