Exemplo n.º 1
0
 $tar->gzip = IntOption('dump_use_compression');
 $tar->path = $DOCUMENT_ROOT_SITE;
 $tar->ReadBlockCurrent = intval($NS['ReadBlockCurrent']);
 $tar->ReadFileSize = intval($NS['ReadFileSize']);
 if (!$tar->openWrite($NS["arc_name"])) {
     RaiseErrorAndDie(GetMessage('DUMP_NO_PERMS'));
 }
 $Block = $tar->Block;
 if (!$NS['startPath']) {
     if (!IntOption('dump_base') && file_exists($f = DOCUMENT_ROOT . BX_ROOT . '/.config.php')) {
         $tar->addFile($f);
     }
 } else {
     $DirScan->startPath = $NS['startPath'];
 }
 $r = $DirScan->Scan($DOCUMENT_ROOT_SITE);
 $NS["data_size"] += 512 * ($tar->Block - $Block);
 $tar->close();
 if ($r === false) {
     RaiseErrorAndDie(implode('<br>', array_merge($tar->err, $DirScan->err)));
 }
 $NS["ReadBlockCurrent"] = $tar->ReadBlockCurrent;
 $NS["ReadFileSize"] = $tar->ReadFileSize;
 $NS["startPath"] = $DirScan->nextPath;
 $NS["cnt"] += $DirScan->FileCount;
 $status_title = GetMessage("MAIN_DUMP_SITE_PROC");
 $status_details = GetMessage("MAIN_DUMP_FILE_CNT") . " <b>" . intval($NS["cnt"]) . "</b>";
 $last_files_count = IntOption('last_files_count');
 if (!$last_files_count) {
     $last_files_count = 100000;
 }
Exemplo n.º 2
0
				if (!$tar->openWrite($NS["arc_name"]))
					RaiseErrorAndDie(GetMessage('DUMP_NO_PERMS'));

				$Block = $tar->Block;
				$DirScan = new CDirRealScan;

				if (!$NS['startPath'])
				{
					if (!IntOption('dump_base') && file_exists($f = DOCUMENT_ROOT.BX_ROOT.'/.config.php'))
						$tar->addFile($f);
				}
				else
					$DirScan->startPath = $NS['startPath'];

				$r = $DirScan->Scan(DOCUMENT_ROOT_SITE);//.$DIR);
				$NS["data_size"] += 512 * ($tar->Block - $Block);
				$tar->close();

				if ($r === false)
					RaiseErrorAndDie(implode('<br>',$DirScan->err));

				$NS["ReadBlockCurrent"] = $tar->ReadBlockCurrent;
				$NS["startPath"] = $DirScan->nextPath;
				$NS["cnt"] += $DirScan->FileCount;

				if ($r !== 'BREAK') // finish
				{
					$NS['arc_size'] = 0;
					$name = $NS["arc_name"];
					while(file_exists($name))
Exemplo n.º 3
0
			'<input type="hidden" name="Step" value="2">';
			$bottom .= ' <input type="button" id="start_button" value="'.getMsg("BUT_TEXT1", LANG).'" onClick="reloadPage(2, \''. LANG.'\')">';
			showMsg(getMsg('TITLE_PROCESS1'),$text,$bottom);
		}
		else
			showMsg(getMsg("ERR_EXTRACT", LANG), getMsg('TAR_ERR_FILE_OPEN', LANG).' '.implode('<br>',$tar->err),$bottom);
	}

	if ($bClearUnusedStep)
	{
		if (file_exists(RESTORE_FILE_LIST))
		{
			include(RESTORE_FILE_LIST);
			$ds = new CDirRealScan;
			$ds->startPath = $_REQUEST['nextPath'];
			$res = $ds->Scan($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules');

			if ($res === 'BREAK')
			{
				$status = getMsg("SEARCHING_UNUSED", LANG);
				$hidden = '<input type="hidden" name="nextPath" value="'.$ds->nextPath.'">'.
					'<input type="hidden" name="clear" value="1">';
				$bottom = '<input type="button" value="'.getMsg('BUT_TEXT_BACK').'"  onClick="reloadPage(1, \''. LANG.'\')"> ';
				showMsg(getMsg('TITLE_PROCESS1'),$status.$hidden,$bottom);
				?><script>reloadPage(2, '<?php 
echo LANG;
?>
', 1);</script><?
				die();
			}
			unlink(RESTORE_FILE_LIST);