Ejemplo n.º 1
0
 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;
 }