Skip to content

Commit

Permalink
apply pull requests from @h3xx to php-epub-meta
Browse files Browse the repository at this point in the history
  • Loading branch information
mikespub committed Mar 28, 2023
1 parent a424fd4 commit c5ad516
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion resources/php-epub-meta/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
],
"license": "MIT",
"require": {
"ext-dom": "*",
"ext-xml": "*",
"ext-zip": "*",
"seblucas/tbszip": "~2.16.0"
"seblucas/tbszip": "~2.16.1"
},
"require-dev": {
"phpunit/phpunit": "9.*"
Expand Down
16 changes: 9 additions & 7 deletions resources/php-epub-meta/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions resources/php-epub-meta/lib/EPub.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
* @author Sébastien Lucas <[email protected]>
*/

define('METADATA_FILE', 'META-INF/container.xml');

class EPub
{
public const METADATA_FILE = 'META-INF/container.xml';
public $xml; //FIXME: change to protected, later
public $toc;
protected $xpath;
Expand Down Expand Up @@ -38,11 +37,11 @@ public function __construct($file, $zipClass = 'clsTbsZip')
}

// read container data
if (!$this->zip->FileExists(METADATA_FILE)) {
if (!$this->zip->FileExists(self::METADATA_FILE)) {
throw new Exception('Unable to find metadata.xml');
}

$data = $this->zip->FileRead(METADATA_FILE);
$data = $this->zip->FileRead(self::METADATA_FILE);
if ($data == false) {
throw new Exception('Failed to access epub container data');
}
Expand Down

0 comments on commit c5ad516

Please sign in to comment.