Исправлен метод удаления модулей с сервера (физическое удаление каталога с модулем)

This commit is contained in:
2026-03-05 15:27:48 +05:00
parent fa7f9317f2
commit 97be1beea6

View File

@@ -596,37 +596,36 @@
}
public function moduleRemove ($dir)
{
global $AVE_Template;
public function moduleRemove ($dir)
{
global $AVE_Template;
$directory = BASE_DIR . '/modules/' . $dir;
$directory = BASE_DIR . '/modules/' . $dir;
$files = glob($directory . '*', GLOB_MARK);
clearstatcache();
foreach ($files as $file)
{
if (substr($file, -1) == '/')
{
$this->moduleRemove($file);
}
elseif (!is_dir($file))
{
unlink($file);
}
if (is_dir($directory)) {
$objects = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($directory, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach($objects as $name => $object){
if ($object->isDir()){
@rmdir($name);
} else {
@unlink($name);
}
}
@rmdir($directory);
}
rrmdir ($directory);
$this->clearModulesCache();
reportLog ($AVE_Template->get_config_vars('MODULES_ACTION_REMOVE') . ' (' . $dir . ')');
$this->clearModulesCache();
// Сохраняем системное сообщение в журнал
reportLog ($AVE_Template->get_config_vars('MODULES_ACTION_REMOVE') . ' (' . $dir . ')');
// Выполняем обновление страницы со списком модулей
header('Location:index.php?do=modules&cp=' . SESSION);
exit;
}
header('Location:index.php?do=modules&cp=' . SESSION);
exit;
}
/**