Skip to content

Commit

Permalink
Move global const into class
Browse files Browse the repository at this point in the history
  • Loading branch information
h3xx committed Feb 7, 2023
1 parent 6b4f19e commit 3e17002
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions 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
{
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 3e17002

Please sign in to comment.