Skip to content

Commit bb4b75d

Browse files
committed
Upgrade Dompdf, Tcpdf, Composer Package
1 parent 345b63a commit bb4b75d

File tree

7 files changed

+124
-143
lines changed

7 files changed

+124
-143
lines changed

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
/.gitattributes export-ignore
44
/.github export-ignore
55
/.gitignore export-ignore
6-
/.php_cs.dist export-ignore
6+
/.phpcs.xml.dist export-ignore
7+
/.php-cs-fixer.dist export-ignore
78
/.scrutinizer.yml export-ignore
89
/CHANGELOG.PHPExcel.md export-ignore
910
/bin export-ignore
1011
/composer.lock export-ignore
1112
/docs export-ignore
1213
/infra export-ignore
1314
/mkdocs.yml export-ignore
15+
/phpstan.neon.dist export-ignore
16+
/phpstan-baseline.neon export-ignore
17+
/phpstan-conditional.neon export-ignore
1418
/phpunit.xml.dist export-ignore
1519
/samples export-ignore
1620
/tests export-ignore

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com)
66
and this project adheres to [Semantic Versioning](https://semver.org).
77

8-
## 1.29.6 - TBD
8+
## 1.29.6 - 2024-12-08
99

1010
### Fixed
1111

1212
- Fix Minor Break Handling Drawings. Backport of [PR #4244](https://github.com/PHPOffice/PhpSpreadsheet/pull/4244)
13+
- Upgrade locked version of Tcpdf (security advisory).
14+
- Upgrade locked version of Dompdf (Php8.4 compatibility).
15+
- Remove unnecessary files from Composer package.
1316

1417
## 1.29.5 - 2024-11-22
1518

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
},
8686
"require-dev": {
8787
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
88-
"dompdf/dompdf": "^1.0 || ^2.0",
88+
"dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
8989
"friendsofphp/php-cs-fixer": "^3.2",
9090
"mitoteam/jpgraph": "^10.3",
9191
"mpdf/mpdf": "^8.1.1",

composer.lock

Lines changed: 110 additions & 107 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PhpSpreadsheet/Helper/Sample.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use PhpOffice\PhpSpreadsheet\Spreadsheet;
99
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
1010
use PhpOffice\PhpSpreadsheet\Writer\IWriter;
11-
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf;
1211
use RecursiveDirectoryIterator;
1312
use RecursiveIteratorIterator;
1413
use RecursiveRegexIterator;
@@ -138,11 +137,7 @@ public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xl
138137
$writerCallback($writer);
139138
}
140139
$callStartTime = microtime(true);
141-
if (PHP_VERSION_ID >= 80400 && $writer instanceof Dompdf) {
142-
@$writer->save($path);
143-
} else {
144-
$writer->save($path);
145-
}
140+
$writer->save($path);
146141
$this->logWrite($writer, $path, /** @scrutinizer ignore-type */ $callStartTime);
147142
if ($this->isCli() === false) {
148143
echo '<a href="/download.php?type=' . pathinfo($path, PATHINFO_EXTENSION) . '&name=' . basename($path) . '">Download ' . basename($path) . '</a><br />';

tests/PhpSpreadsheetTests/Functional/StreamTest.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
use PhpOffice\PhpSpreadsheet\Spreadsheet;
77
use PHPUnit\Framework\TestCase;
88

9-
/**
10-
* Not clear that Dompdf will be Php8.4 compatible in time.
11-
* Run in separate process and add version test till it is ready.
12-
*
13-
* @runTestsInSeparateProcesses
14-
*/
159
class StreamTest extends TestCase
1610
{
1711
public static function providerFormats(): array
@@ -46,11 +40,7 @@ public function testAllWritersCanWriteToStream(string $format): void
4640
} else {
4741
self::assertSame(0, $stat['size']);
4842

49-
if ($format === 'Dompdf' && PHP_VERSION_ID >= 80400) {
50-
@$writer->save($stream);
51-
} else {
52-
$writer->save($stream);
53-
}
43+
$writer->save($stream);
5444

5545
self::assertIsResource($stream, 'should not close the stream for further usage out of PhpSpreadsheet');
5646
$stat = fstat($stream);

0 commit comments

Comments
 (0)