diff --git a/module/upgrade/config.php b/module/upgrade/config.php index e4a3279710..0f094a5ece 100644 --- a/module/upgrade/config.php +++ b/module/upgrade/config.php @@ -48,5 +48,6 @@ $config->upgrade->discardedBugTypes['zh-tw']['designchange'] = '設計變更'; $config->upgrade->discardedBugTypes['zh-tw']['newfeature'] = "新增需求"; $config->upgrade->discardedBugTypes['zh-tw']['trackthings'] = '事務跟蹤'; -$config->delete['10.6'][] = 'module/chat/ext/control/extensions.php'; -$config->delete['10.6'][] = 'module/common/ext/model/xuanxuan.php'; +$config->delete['10.6'][] = 'module/chat/ext/control/extensions.php'; +$config->delete['10.6'][] = 'module/common/ext/model/xuanxuan.php'; +$config->delete['12.4.2'][] = 'www/js/ueditor'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 0743d048d3..3cbf97a3f3 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -911,16 +911,28 @@ class upgradeModel extends model public function deleteFiles() { $result = array(); + $zfile = $this->app->loadClass('zfile'); + foreach($this->config->delete as $deleteFiles) { $basePath = $this->app->getBasePath(); + foreach($deleteFiles as $file) { if(isset($this->config->excludeFiles[$file])) continue; + $fullPath = $basePath . str_replace('/', DIRECTORY_SEPARATOR, $file); - if(file_exists($fullPath) and !unlink($fullPath)) $result[] = $fullPath; + if(file_exists($fullPath)) + { + if((is_dir($fullPath) and !$zfile->removeDir($fullPath)) or + (is_file($fullPath) and !$zfile->removeFile($fullPath))) + { + $result[] = $fullPath; + } + } } } + return $result; }