Skip to content

Commit 7e04910

Browse files
committed
Prepare for PHAR creation.
1 parent cc00279 commit 7e04910

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/application/createDocs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
require '../../vendor/autoload.php';
33
require 'CreateDocsCommand.php';
44
use Symfony\Component\Console\Application;
5+
error_reporting(0);
56

67
$app = new Application('phpDoc2pdf');
78
$app->add(new \application\CreateDocsCommand());

src/create_documentation/PDFFile.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PDFFile extends \Mpdf\Mpdf {
1010
/**
1111
* @var string
1212
*/
13-
private $templatesPath = '../../templates/default';
13+
private $templatesPath = '/templates/default';
1414

1515
/**
1616
* @var \League\Plates\Engine
@@ -33,9 +33,12 @@ class PDFFile extends \Mpdf\Mpdf {
3333
* @throws \Mpdf\MpdfException
3434
*/
3535
public function __construct(string $path) {
36+
$this->templatesPath = \Phar::running() !== '' ? \Phar::running() . $this->templatesPath
37+
: '../../templates/default';
3638
$this->path = $path;
3739
$this->templatesEngine = new \League\Plates\Engine($this->templatesPath);
38-
parent::__construct();
40+
parent::__construct(['tempDir' => sys_get_temp_dir() . '/mpdf']);
41+
$this->simpleTables = true;
3942
}
4043

4144
/**

0 commit comments

Comments
 (0)