Mpdf Caching

Mpdf caches font data in a temporary directory. When running the test suite, it uses different directories for samples vs. normal tests. One is sufficient. This will slightly reduce disk usage and overhead when running test suite.
This commit is contained in:
Owen Leibman 2021-04-29 00:10:22 -07:00
parent b05dc31850
commit 6c9c8db267
1 changed files with 0 additions and 6 deletions

View File

@ -5,7 +5,6 @@ namespace PhpOffice\PhpSpreadsheet\Helper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\IWriter; use PhpOffice\PhpSpreadsheet\Writer\IWriter;
use PhpOffice\PhpSpreadsheet\Writer\Pdf;
use RecursiveDirectoryIterator; use RecursiveDirectoryIterator;
use RecursiveIteratorIterator; use RecursiveIteratorIterator;
use RecursiveRegexIterator; use RecursiveRegexIterator;
@ -119,11 +118,6 @@ class Sample
foreach ($writers as $writerType) { foreach ($writers as $writerType) {
$path = $this->getFilename($filename, mb_strtolower($writerType)); $path = $this->getFilename($filename, mb_strtolower($writerType));
$writer = IOFactory::createWriter($spreadsheet, $writerType); $writer = IOFactory::createWriter($spreadsheet, $writerType);
if ($writer instanceof Pdf) {
// PDF writer needs temporary directory
$tempDir = $this->getTemporaryFolder();
$writer->setTempDir($tempDir);
}
$callStartTime = microtime(true); $callStartTime = microtime(true);
$writer->save($path); $writer->save($path);
$this->logWrite($writer, $path, $callStartTime); $this->logWrite($writer, $path, $callStartTime);