• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/tar_gz.php
  • Класс: CArchiver
  • Вызов: CArchiver::addFile
public function addFile($strFilename, $strAddPath, $strRemovePath)
{
	$strAddPath = str_replace("\", "/", $strAddPath);
	$strRemovePath = str_replace("\", "/", $strRemovePath);

	if (!$this->_dFile)
	{
		$this->_arErrors[] = ["ERR_DFILE", GetMessage("MAIN_ARCHIVE_ERR_DFILE")];
		return false;
	}

	if ($strFilename == '')
	{
		return false;
	}

	if (!file_exists($this->io->GetPhysicalName($strFilename)))
	{
		$this->_arErrors[] = ["NO_FILE", "File '" . $strFilename . "' does not exist"];
		return false;
	}

	if (!$this->_addFile($strFilename, $strAddPath, $strRemovePath))
	{
		return false;
	}

	return true;
}