From 5d083993df6d5d7f3cc62106d104e50ba5f05d8d Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 18 Sep 2024 09:23:15 +0200 Subject: [PATCH] use unlink() to delete js files in cache, because rm can fail for a large number of files --- controllers/class.ClearCache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/class.ClearCache.php b/controllers/class.ClearCache.php index 116079dfd..b91f51791 100644 --- a/controllers/class.ClearCache.php +++ b/controllers/class.ClearCache.php @@ -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)) {