From: Vincent Vanwaelscappel Date: Tue, 17 May 2022 15:16:49 +0000 (+0200) Subject: wip #5220 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7bffe642dcc8c5a871447b97aa325042089f3340;p=fluidbook_tools.git wip #5220 --- diff --git a/.idea/misc.xml b/.idea/misc.xml index c391c5f..ff9d5a0 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -6,9 +6,4 @@ - - - \ No newline at end of file diff --git a/src/Jobs/ProcessPage.php b/src/Jobs/ProcessPage.php index 7b08fb1..f64edf5 100644 --- a/src/Jobs/ProcessPage.php +++ b/src/Jobs/ProcessPage.php @@ -31,16 +31,22 @@ class ProcessPage implements ShouldQueue */ protected $files = []; + /** + * @var bool + */ + protected $debug=true; + /** * @param $document Document * @param $page integer * @param ProcessFile[] $files */ - public function __construct($document, $page, $files = []) + public function __construct($document, $page, $files = [],$debug=true) { $this->document = $document; $this->page = $page; $this->files = $files; + $this->debug=$debug; } /** @@ -69,11 +75,15 @@ class ProcessPage implements ShouldQueue public function handle() { - start_measure('Process page ' . $this->page); + if($this->debug) { + start_measure('Process page ' . $this->page); + } foreach ($this->files as $file) { $this->getFile($this->page, $file, false); } - stop_measure('Process page ' . $this->page); + if($this->debug) { + stop_measure('Process page ' . $this->page); + } } @@ -115,7 +125,9 @@ class ProcessPage implements ShouldQueue return; } - start_measure('Split PDF'); + if($this->debug) { + start_measure('Split PDF'); + } touch($lock); Files::mkdir($this->getOut() . '/pdf'); @@ -143,7 +155,9 @@ class ProcessPage implements ShouldQueue } } unlink($lock); - stop_measure('Split PDF'); + if($this->debug) { + stop_measure('Split PDF'); + } } /**