Skip to content

Commit 2251827

Browse files
committed
Merge branch 'release/2.0.0'
2 parents 4c2bb3a + 56730f0 commit 2251827

File tree

5 files changed

+42
-38
lines changed

5 files changed

+42
-38
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2.0.0] - 2020-11-05
8+
### Changed
9+
- Upgraded DomPPDF dependency to 0.8.6 and added chroot setting
10+
711
## [1.4.0] - 2020-10-15
812
### Changed
913
- `PdfMerge` class can now automatically instantiate the merger class

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@
2626
},
2727
"require": {
2828
"php": "^5.6|^7",
29-
"dompdf/dompdf": "<=0.8.5",
30-
"setasign/fpdi": "*",
29+
"dompdf/dompdf": "^0.8",
30+
"setasign/fpdi": "^2.0",
3131
"setasign/fpdi-fpdf": "^2"
3232
},
3333
"require-dev": {
3434
"phpunit/phpunit": "^7",
3535
"phpstan/phpstan": "^0.12.11",
36-
"phpstan/phpstan-phpunit": "^0.12.6"
36+
"phpstan/phpstan-phpunit": "^0.12.6",
37+
"roave/backward-compatibility-check": "^5.0"
3738
},
3839
"suggest": {
3940
"vianetz/signaturportal-api": "Use this library to sign your generated PDF documents.",
4041
"zf1/zend-pdf": "Necessary if you want to use Zend_Pdf for merging. By default this package uses the fpdi merger."
4142
}
42-
}
43+
}

src/Model/Config.php

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@
2121

2222
final class Config
2323
{
24-
/**
25-
* @var string
26-
*/
24+
/** @var string */
2725
const PAPER_ORIENTATION_LANDSCAPE = 'landscape';
2826

29-
/**
30-
* @var string
31-
*/
27+
/** @var string */
3228
const PAPER_ORIENTATION_PORTRAIT = 'portrait';
3329

3430
/**
@@ -37,30 +33,23 @@ final class Config
3733
*/
3834
private $pdfSize = 'a4';
3935

40-
/**
41-
* @var string
42-
*/
36+
/** @var string */
4337
private $pdfOrientation;
4438

45-
/**
46-
* @var string
47-
*/
39+
/** @var string */
4840
private $pdfAuthor = '';
4941

50-
/**
51-
* @var string
52-
*/
42+
/** @var string */
5343
private $pdfTitle = '';
5444

55-
/**
56-
* @var boolean
57-
*/
45+
/** @var boolean */
5846
private $isDebugMode = false;
5947

60-
/**
61-
* @var string
62-
*/
63-
private $tempDir = '';
48+
/** @var string */
49+
private $tempDir;
50+
51+
/** @var string */
52+
private $chrootDir = '/';
6453

6554
public function __construct()
6655
{
@@ -113,14 +102,21 @@ public function getTempDir()
113102
return $this->tempDir;
114103
}
115104

105+
/**
106+
* @return string
107+
*/
108+
public function getChrootDir()
109+
{
110+
return $this->chrootDir;
111+
}
112+
116113
/**
117114
* @param string $pdfSize
118115
* @return Config
119116
*/
120117
public function setPdfSize($pdfSize)
121118
{
122119
$this->pdfSize = $pdfSize;
123-
124120
return $this;
125121
}
126122

@@ -131,7 +127,6 @@ public function setPdfSize($pdfSize)
131127
public function setPdfOrientation($pdfOrientation)
132128
{
133129
$this->pdfOrientation = $pdfOrientation;
134-
135130
return $this;
136131
}
137132

@@ -142,7 +137,6 @@ public function setPdfOrientation($pdfOrientation)
142137
public function setPdfAuthor($pdfAuthor)
143138
{
144139
$this->pdfAuthor = $pdfAuthor;
145-
146140
return $this;
147141
}
148142

@@ -153,7 +147,6 @@ public function setPdfAuthor($pdfAuthor)
153147
public function setPdfTitle($pdfTitle)
154148
{
155149
$this->pdfTitle = $pdfTitle;
156-
157150
return $this;
158151
}
159152

@@ -164,7 +157,6 @@ public function setPdfTitle($pdfTitle)
164157
public function setIsDebugMode($isDebugMode)
165158
{
166159
$this->isDebugMode = $isDebugMode;
167-
168160
return $this;
169161
}
170162

@@ -175,7 +167,17 @@ public function setIsDebugMode($isDebugMode)
175167
public function setTempDir($tempDir)
176168
{
177169
$this->tempDir = $tempDir;
170+
return $this;
171+
}
178172

173+
/**
174+
* @param string $chrootDir
175+
*
176+
* @return $this
177+
*/
178+
public function setChrootDir($chrootDir)
179+
{
180+
$this->chrootDir = $chrootDir;
179181
return $this;
180182
}
181183
}

src/Model/Generator/AbstractGenerator.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@
3535
*/
3636
abstract class AbstractGenerator implements GeneratorInterface
3737
{
38-
/**
39-
* @var string
40-
*/
38+
/** @var string */
4139
const DEBUG_FILE_NAME = 'vianetz_pdf_generator_debug.html';
4240

43-
/**
44-
* @var \Vianetz\Pdf\Model\Config $config
45-
*/
41+
/** @var \Vianetz\Pdf\Model\Config $config */
4642
protected $config;
4743

4844
/**

src/Model/Generator/Dompdf.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ private function getDompdfOptions()
102102
{
103103
return array(
104104
'isPhpEnabled' => true,
105-
'isRemoteEnabled' => true
105+
'isRemoteEnabled' => true,
106+
'chroot' => $this->config->getChrootDir(),
106107
);
107108
}
108109
}

0 commit comments

Comments
 (0)