• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/update_class.php
  • Класс: CUpdater
  • Вызов: CUpdater::CopyFiles
function CopyFiles($fromDir, $toDir)
{
	if (!in_array("KERNEL", $this->callType))
		return true;

	CUpdateSystem::AddMessage2Log("Run updater '".$this->updater."': CopyFiles(".$fromDir.", ".$toDir.")", "CRUPDCF1");

	$errorMessage = "";

	if (substr($fromDir, 0, 1) != "/")
		$fromDir = $this->curModulePath."/".$fromDir;
	if (substr($toDir, 0, 1) != "/")
		$toDir = $this->kernelPath."/".$toDir;

	$fromDirFull = $_SERVER["DOCUMENT_ROOT"].$fromDir;
	$toDirFull = $_SERVER["DOCUMENT_ROOT"].$toDir;

	if (!file_exists($fromDirFull))
		return true;

	$result = CUpdateSystem::CopyDirFiles($fromDirFull, $toDirFull, $errorMessage);

	if (!$result)
		$this->errorMessage[] = $errorMessage;

	return $result;
}