Add getPath
This commit is contained in:
parent
ae4d9f74ef
commit
5a68cce19e
|
@ -5,6 +5,7 @@ namespace Zoomyboy\Tex;
|
||||||
use Illuminate\Contracts\Support\Responsable;
|
use Illuminate\Contracts\Support\Responsable;
|
||||||
use Illuminate\Http\File;
|
use Illuminate\Http\File;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
use Log;
|
||||||
|
|
||||||
abstract class BaseCompiler implements Responsable
|
abstract class BaseCompiler implements Responsable
|
||||||
{
|
{
|
||||||
|
@ -26,6 +27,7 @@ abstract class BaseCompiler implements Responsable
|
||||||
$this->refreshFile();
|
$this->refreshFile();
|
||||||
|
|
||||||
if (!$this->file->isFile()) {
|
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);
|
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
|
protected function prepareForCompilation(Document $document): void
|
||||||
{
|
{
|
||||||
$workDir = '/tmp/'.Str::random(32);
|
$workDir = '/tmp/'.Str::random(32);
|
||||||
|
|
Loading…
Reference in New Issue