- Модуль: main
- Путь к файлу: ~/bitrix/modules/main/classes/general/zip.php
- Класс: CZip
- Вызов: CZip::_addList
private function _addList($arFilesList, &$arResultList, $addDir, $removeDir, $removeAllDir, &$arParams)
{
$arHeaders = [];
if (($res = $this->_addFileList($arFilesList, $arHeaders, $addDir, $removeDir, $removeAllDir, $arParams)) != 1)
{
return $res;
}
//save the offset of the central dir
$offset = @ftell($this->zipfile);
//make central dir files header
for ($i = 0, $counter = 0; $i < sizeof($arHeaders); $i++)
{
if ($arHeaders[$i]['status'] == 'ok')
{
if (($res = $this->_writeCentralFileHeader($arHeaders[$i])) != 1)
{
return $res;
}
$counter++;
}
$this->_convertHeader2FileInfo($arHeaders[$i], $arResultList[$i]);
}
$zip_comment = '';
//the size of the central header
$size = @ftell($this->zipfile) - $offset;
//add central dir footer
if (($res = $this->_writeCentralHeader($counter, $size, $offset, $zip_comment)) != 1)
{
unset($arHeaders);
return $res;
}
return $res;
}