From fd774948fbfc7e749bd2fa22edfcdac5b625f84d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Didier=20Corbi=C3=A8re?= Date: Wed, 11 Sep 2013 00:46:19 +0100 Subject: [PATCH] Add zipClass parameter in the constructor, to be able to replace the default clsTbsZip class --- resources/php-epub-meta/epub.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/php-epub-meta/epub.php b/resources/php-epub-meta/epub.php index 7cd46be..6dcc19f 100644 --- a/resources/php-epub-meta/epub.php +++ b/resources/php-epub-meta/epub.php @@ -26,12 +26,13 @@ class EPub { * Constructor * * @param string $file path to epub file to work on + * @param string $zipClass class to handle zip * @throws Exception if metadata could not be loaded */ - public function __construct($file){ + public function __construct($file, $zipClass = 'clsTbsZip'){ // open file $this->file = $file; - $this->zip = new clsTbsZip(); + $this->zip = new $zipClass(); if(!$this->zip->Open($this->file)){ throw new Exception('Failed to read epub file'); }