Skip to content

Commit

Permalink
Upgrade Dompdf, Tcpdf, Composer Package
Browse files Browse the repository at this point in the history
  • Loading branch information
oleibman committed Dec 8, 2024
1 parent 345b63a commit bb4b75d
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 143 deletions.
6 changes: 5 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/.phpcs.xml.dist export-ignore
/.php-cs-fixer.dist export-ignore
/.scrutinizer.yml export-ignore
/CHANGELOG.PHPExcel.md export-ignore
/bin export-ignore
/composer.lock export-ignore
/docs export-ignore
/infra export-ignore
/mkdocs.yml export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/phpstan-conditional.neon export-ignore
/phpunit.xml.dist export-ignore
/samples export-ignore
/tests export-ignore
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com)
and this project adheres to [Semantic Versioning](https://semver.org).

## 1.29.6 - TBD
## 1.29.6 - 2024-12-08

### Fixed

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

## 1.29.5 - 2024-11-22

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^1.0 || ^2.0",
"dompdf/dompdf": "^1.0 || ^2.0 || ^3.0",
"friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.3",
"mpdf/mpdf": "^8.1.1",
Expand Down
217 changes: 110 additions & 107 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions src/PhpSpreadsheet/Helper/Sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Writer\IWriter;
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use RecursiveRegexIterator;
Expand Down Expand Up @@ -138,11 +137,7 @@ public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xl
$writerCallback($writer);
}
$callStartTime = microtime(true);
if (PHP_VERSION_ID >= 80400 && $writer instanceof Dompdf) {
@$writer->save($path);
} else {
$writer->save($path);
}
$writer->save($path);
$this->logWrite($writer, $path, /** @scrutinizer ignore-type */ $callStartTime);
if ($this->isCli() === false) {
echo '<a href="/download.php?type=' . pathinfo($path, PATHINFO_EXTENSION) . '&name=' . basename($path) . '">Download ' . basename($path) . '</a><br />';
Expand Down
12 changes: 1 addition & 11 deletions tests/PhpSpreadsheetTests/Functional/StreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PHPUnit\Framework\TestCase;

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

if ($format === 'Dompdf' && PHP_VERSION_ID >= 80400) {
@$writer->save($stream);
} else {
$writer->save($stream);
}
$writer->save($stream);

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

0 comments on commit bb4b75d

Please sign in to comment.