* finish task #7798.

This commit is contained in:
z
2020-09-03 16:59:00 +08:00
parent 8e2f4654c4
commit 0244080f1a
2 changed files with 16 additions and 3 deletions
+3 -2
View File
@@ -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';
+13 -1
View File
@@ -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;
}