- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/tar_gz.php
- Класс: CArchiver
- Вызов: CArchiver::__construct
public function __construct($strArchiveName, $bCompress = false, $start_time = -1, $max_exec_time = -1, $pos = 0, $stepped = false)
{
$this->io = CBXVirtualIo::GetInstance();
$this->max_exec_time = $max_exec_time;
$this->start_time = $start_time;
$this->file_pos = $pos;
$this->_bCompress = $bCompress;
$this->stepped = $stepped;
if (!$bCompress)
{
if (@file_exists($this->io->GetPhysicalName($strArchiveName)))
{
if ($fp = @fopen($this->io->GetPhysicalName($strArchiveName), "rb"))
{
$data = fread($fp, 2);
fclose($fp);
if ($data == "37213")
{
$this->_bCompress = true;
}
}
}
else
{
if (mb_substr($strArchiveName, -2) == 'gz')
{
$this->_bCompress = true;
}
}
}
else
{
$this->_bCompress = true;
}
$this->_strArchiveName = $strArchiveName;
$this->_arErrors = [];
}