From 5a68cce19e4e83b32ef12416420c31386bd86795 Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Mon, 31 Oct 2022 14:36:38 +0100 Subject: [PATCH] Add getPath --- src/BaseCompiler.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/BaseCompiler.php b/src/BaseCompiler.php index c121934..35dae9d 100644 --- a/src/BaseCompiler.php +++ b/src/BaseCompiler.php @@ -5,6 +5,7 @@ namespace Zoomyboy\Tex; use Illuminate\Contracts\Support\Responsable; use Illuminate\Http\File; use Illuminate\Support\Str; +use Log; abstract class BaseCompiler implements Responsable { @@ -26,6 +27,7 @@ abstract class BaseCompiler implements Responsable $this->refreshFile(); if (!$this->file->isFile()) { + Log::error('Compilation failed', ['body' => $contents, 'output' => $output, 'dir' => $this->file->getPath(), 'command' => $this->command($document)]); throw (new CompilerException('Compilation failed.'))->setOutput($output); } @@ -40,6 +42,11 @@ abstract class BaseCompiler implements Responsable ]); } + public function getPath(): string + { + return $this->file->getRealPath(); + } + protected function prepareForCompilation(Document $document): void { $workDir = '/tmp/'.Str::random(32);