From 1adb8d2123483221618fd629898c7bc7d8772c01 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 1 Jun 2023 11:28:07 +0200 Subject: [PATCH] wip #5977 @0.25 --- src/Compiler/Compiler.php | 13 +++++++++++++ src/Compiler/CompilerInterface.php | 2 ++ src/Compiler/DummyCompiler.php | 4 ++++ src/Links/ZoomLink.php | 2 +- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Compiler/Compiler.php b/src/Compiler/Compiler.php index 1a70147..97b74e3 100644 --- a/src/Compiler/Compiler.php +++ b/src/Compiler/Compiler.php @@ -370,4 +370,17 @@ class Compiler implements ShouldQueue, ShouldBeUnique, CompilerInterface { public function getHeightForLinks() { return $this->getHeight() / $this->getLinkScale(); } + + + public function isSinglePage(): bool { + // TODO: Implement isSinglePage() method. + } + + public function isDoublePage(): bool { + // TODO: Implement isDoublePage() method. + } + + public function getPageNumber(): int { + return (int)$this->config->pages; + } } diff --git a/src/Compiler/CompilerInterface.php b/src/Compiler/CompilerInterface.php index 6bcb4fd..e03fc20 100644 --- a/src/Compiler/CompilerInterface.php +++ b/src/Compiler/CompilerInterface.php @@ -63,4 +63,6 @@ interface CompilerInterface { public function addPDFJS($force = false); public function addSEOArticle($page, $title, $intro, $image, $id = null, $url = null, $content = ''); + + public function getPageNumber(): int; } diff --git a/src/Compiler/DummyCompiler.php b/src/Compiler/DummyCompiler.php index 017e438..9a6531c 100644 --- a/src/Compiler/DummyCompiler.php +++ b/src/Compiler/DummyCompiler.php @@ -131,4 +131,8 @@ class DummyCompiler implements CompilerInterface { public function isDoublePage(): bool { return !$this->isSinglePage(); } + + public function getPageNumber(): int { + // TODO: Implement getPageNumber() method. + } } diff --git a/src/Links/ZoomLink.php b/src/Links/ZoomLink.php index f4c8260..3b9d5c7 100644 --- a/src/Links/ZoomLink.php +++ b/src/Links/ZoomLink.php @@ -150,7 +150,7 @@ class ZoomLink extends NormalLink { null, $extractOptions, $cache); if (!file_exists($rightfile)) { - die('Error generating right part ' . $rightfile); + throw new \Exception('Error generating right part ' . $rightfile); } $both = $cache . hash('sha256', $leftfile . $rightfile) . '.jpg'; -- 2.39.5