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');
}
}