public function zipFile($files, $archive) { $this->timeout = 20 * 60 * 60; /*20 minutes*/ $mem = '512M'; // @codingStandardsIgnoreStart @ini_set('memory_limit', $mem); @set_time_limit($this->timeout); @ini_set('max_execution_time', $this->timeout); // @codingStandardsIgnoreEnd if (!is_array($files)) { $files = array($files); } if (null !== $this->archiver) { $success = $this->archiver->zipFile($files, $archive); } else { if ($this->checkZipSupport()) { $success = $this->_zipFile($files, $archive); } else { if ($this->checkZipConsole()) { $success = $this->_zipFileConsole($files, $archive); } else { $success = $this->_zipFilePcl($files, $archive); } } } return $success; }
$tarFile = new BZip2_Archiver($filename); break; case 'gz': $saveasname = "{$basename}.tar.gz"; $filename = $tmpDir . "/" . $saveasname; $tarFile = new GZip_Archiver($filename); break; case 'zip': $saveasname = "{$basename}.zip"; $filename = $tmpDir . "/" . $saveasname; $tarFile = new Zip_Archiver($filename); break; default: $saveasname = "{$basename}.tar"; $filename = $tmpDir . "/" . $saveasname; $tarFile = new Tar_Archiver($filename); break; } $cdindex_path = $php_root_path . $privilege_root_path . "/cdindex/"; ob_start(); include $cdindex_path . "technical_program_cd.php"; $htmlFile = ob_get_contents(); ob_end_clean(); $tarFile->AddString("technical_program_cd.html", $htmlFile); ob_start(); include $cdindex_path . "technical_program_web.php"; $htmlFile = ob_get_contents(); ob_end_clean(); $tarFile->AddString("technical_program_web.html", $htmlFile); ob_start(); include $cdindex_path . "technical_program_guide.php";