protected function zipEpub( $filename ) {

		$zip = new \PclZip( $filename );

		// Open Publication Structure 2.0.1
		// mimetype must be uncompressed, unencrypted, and the first file in the ZIP archive
		$list = $zip->create( $this->tmpDir . '/mimetype', PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_REMOVE_ALL_PATH );
		if ( 0 === absint( $list ) ) {
			return false;
		}

		$files = [];
		foreach ( new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( $this->tmpDir ) ) as $file ) {
			if ( ! $file->isFile() ) {
				continue;
			}
			if ( 'mimetype' === $file->getFilename() ) {
				continue;
			}
			$files[] = $file->getPathname();
		}

		$list = $zip->add( $files, '', $this->tmpDir );
		if ( 0 === absint( $list ) ) {
			return false;
		}

		return true;
	}
protected function zipEpub( $filename ) {

		$zip = new \PclZip( $filename );

		// Open Publication Structure 2.0.1
		// mimetype must be uncompressed, unencrypted, and the first file in the ZIP archive
		$list = $zip->create( $this->tmpDir . '/mimetype', PCLZIP_OPT_NO_COMPRESSION, PCLZIP_OPT_REMOVE_ALL_PATH );
		if ( 0 === absint( $list ) ) {
			return false;
		}

		$files = [];
		foreach ( new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( $this->tmpDir ) ) as $file ) {
			if ( ! $file->isFile() ) {
				continue;
			}
			if ( 'mimetype' === $file->getFilename() ) {
				continue;
			}
			$files[] = $file->getPathname();
		}

		$list = $zip->add( $files, '', $this->tmpDir );
		if ( 0 === absint( $list ) ) {
			return false;
		}

		return true;
	}
protected function zipEpub ( $ filename ) { $ zip = new \ PclZip ( $ filename ) ; // Open Publication Structure 2.0.1 // mimetype must be uncompressed, unencrypted, and the first file in the ZIP archive $ list = $ zip -> create ( $ this -> tmpDir . '/mimetype' , PCLZIP_OPT_NO_COMPRESSION , PCLZIP_OPT_REMOVE_ALL_PATH ) ; if ( 0 === absint ( $ list ) ) { return false ; } $ files = [ ] ; foreach ( new \ RecursiveIteratorIterator ( new \ RecursiveDirectoryIterator ( $ this -> tmpDir ) ) as $ file ) { if ( ! $ file -> isFile ( ) ) { continue ; } if ( 'mimetype' === $ file -> getFilename ( ) ) { continue ; } $ files [ ] = $ file -> getPathname ( ) ; } $ list = $ zip -> add ( $ files , '' , $ this -> tmpDir ) ; if ( 0 === absint ( $ list ) ) { return false ; } return true ; }
Zip the contents of an EPUB following the conventions outlined in Open Publication Structure 2.0.1

@param $filename

@return bool
Zip the contents of an EPUB following the conventions outlined in Open Publication Structure 2 . 0 . 1