PressBooks\Modules\Import\Epub\Epub201::setCurrentZip PHP Метод

setCurrentZip() защищенный Метод

Opens a new Epub for reading, writing or modifying
protected setCurrentZip ( string $fullpath )
$fullpath string
    protected function setCurrentZip($fullpath)
    {
        $result = $this->zip->open($fullpath);
        if (true !== $result) {
            throw new \Exception('Opening epub file failed');
        }
        /* Safety dance */
        /*
        // TODO: Do we need this? Some EPUBs are garbage...
        $mimetype = $this->getZipContent( 'mimetype', false );
        if ( $mimetype != 'application/epub+zip' ) {
        	throw new \Exception ( 'Wrong mimetype!' );
        }
        */
        $ok = $this->getZipContent('META-INF/container.xml');
        if (!$ok) {
            throw new \Exception('Bad or corrupted META-INF/container.xml');
        }
    }