- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/update_class.php
- Класс: CUpdater
- Вызов: CUpdater::InstallWizard
function InstallWizard($wizardName, $arDeleteFiles = array())
{
if (!in_array("KERNEL", $this->callType))
return true;
CUpdateSystem::AddMessage2Log("Run updater '".$this->updater."': InstallWizard(".$wizardName.")", "CRUPDIC1");
$errorMessage = "";
$wizardPath = $this->__MakeComponentPath($wizardName);
if ($wizardPath == '')
{
CUpdateSystem::AddMessage2Log("Wrong wizard name", "CRUPDIC2");
return false;
}
if (!file_exists($_SERVER["DOCUMENT_ROOT"].$this->curModulePath."/install/wizards".$wizardPath))
{
CUpdateSystem::AddMessage2Log("Wizard is not found", "CRUPDIC3");
return false;
}
if (!empty($arDeleteFiles))
{
for ($i = 0, $cnt = count($arDeleteFiles); $i < $cnt; $i++)
{
$path2Modules = $_SERVER["DOCUMENT_ROOT"].US_SHARED_KERNEL_PATH."/modules/".$this->moduleID."/install/wizards".$wizardPath;
$path2Wizards = $_SERVER["DOCUMENT_ROOT"].US_SHARED_KERNEL_PATH."/wizards/".$wizardPath;
if (file_exists($path2Modules.$arDeleteFiles[$i]))
@unlink($path2Modules.$arDeleteFiles[$i]);
if (file_exists($path2Wizards.$arDeleteFiles[$i]))
@unlink($path2Wizards.$arDeleteFiles[$i]);
}
}
return $this->CopyDirFiles($this->curModulePath."/install/wizards".$wizardPath, US_SHARED_KERNEL_PATH."/wizards".$wizardPath);
}