From 3e170026a0c91b74b098ff1436e1175ddb97d322 Mon Sep 17 00:00:00 2001 From: Dan Church Date: Tue, 7 Feb 2023 15:13:05 -0600 Subject: [PATCH] Move global const into class --- lib/EPub.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/EPub.php b/lib/EPub.php index 29120e0..cf9ebc1 100644 --- a/lib/EPub.php +++ b/lib/EPub.php @@ -6,10 +6,9 @@ * @author Sébastien Lucas */ -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; @@ -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'); }