public function finalize() {
    if (!$this->isFinalized) {

      // print central directory
      $cd = implode('', $this->cdRec);
      $this->write($cd);

      if ($this->zip64) {
        // print the zip64 end of central directory record
        $this->write($this->buildZip64EndOfCentralDirectoryRecord(strlen($cd)));

        // print the zip64 end of central directory locator
        $this->write($this->buildZip64EndOfCentralDirectoryLocator(strlen($cd)));
      }

      // print end of central directory record
      $this->write($this->buildEndOfCentralDirectoryRecord(strlen($cd)));

      $this->flush();

      $this->isFinalized = true;
      $cd = null;
      $this->cdRec = null;

      return true;
    }
    return false;
  }
public function finalize() {
    if (!$this->isFinalized) {

      // print central directory
      $cd = implode('', $this->cdRec);
      $this->write($cd);

      if ($this->zip64) {
        // print the zip64 end of central directory record
        $this->write($this->buildZip64EndOfCentralDirectoryRecord(strlen($cd)));

        // print the zip64 end of central directory locator
        $this->write($this->buildZip64EndOfCentralDirectoryLocator(strlen($cd)));
      }

      // print end of central directory record
      $this->write($this->buildEndOfCentralDirectoryRecord(strlen($cd)));

      $this->flush();

      $this->isFinalized = true;
      $cd = null;
      $this->cdRec = null;

      return true;
    }
    return false;
  }
public function finalize ( ) { if ( ! $ this -> isFinalized ) { // print central directory $ cd = implode ( '' , $ this -> cdRec ) ; $ this -> write ( $ cd ) ; if ( $ this -> zip64 ) { // print the zip64 end of central directory record $ this -> write ( $ this -> buildZip64EndOfCentralDirectoryRecord ( strlen ( $ cd ) ) ) ; // print the zip64 end of central directory locator $ this -> write ( $ this -> buildZip64EndOfCentralDirectoryLocator ( strlen ( $ cd ) ) ) ; } // print end of central directory record $ this -> write ( $ this -> buildEndOfCentralDirectoryRecord ( strlen ( $ cd ) ) ) ; $ this -> flush ( ) ; $ this -> isFinalized = true ; $ cd = null ; $ this -> cdRec = null ; return true ; } return false ; }
Close the archive.
A closed archive can no longer have new files added to it. After
closing, the zip file is completely written to the output stream.
@return bool $success
Close the archive . A closed archive can no longer have new files added to it . After closing the zip file is completely written to the output stream .