From: Vincent Vanwaelscappel Date: Wed, 20 Sep 2023 08:37:39 +0000 (+0200) Subject: wip #6296 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e7faab29199652822d962ac6bff04f79ec794b83;p=cubist_pdf.git wip #6296 @0.25 --- diff --git a/.idea/cubist_pdf.iml b/.idea/cubist_pdf.iml index 8fb6409..5fb2ac8 100644 --- a/.idea/cubist_pdf.iml +++ b/.idea/cubist_pdf.iml @@ -4,6 +4,7 @@ + @@ -15,7 +16,6 @@ - @@ -35,13 +35,11 @@ - - @@ -49,7 +47,6 @@ - @@ -61,10 +58,22 @@ - + + + + + + + + + + + + + diff --git a/.idea/php.xml b/.idea/php.xml index 17f3a0c..64d41f3 100644 --- a/.idea/php.xml +++ b/.idea/php.xml @@ -13,7 +13,6 @@ - @@ -33,13 +32,11 @@ - - @@ -47,7 +44,6 @@ - @@ -59,13 +55,30 @@ - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PDFTools.php b/src/PDFTools.php index 8d6a8cc..dc87d88 100644 --- a/src/PDFTools.php +++ b/src/PDFTools.php @@ -4,14 +4,13 @@ namespace Cubist\PDF; use Cubist\Util\CommandLine; use Cubist\Util\Files\Files; -use Cubist\Util\Str; use Cubist\Util\Text; +use Cubist\Util\Cache; use DOMDocument; use DOMElement; use DOMNode; use DOMXPath; use Cubist\PDF\CommandLine\FWSTK; -use Illuminate\Support\Facades\Cache; class PDFTools { @@ -120,9 +119,10 @@ class PDFTools throw new \Exception('Unable to parse infos of ' . $pdf . ' : file not found'); } + $cacheKey = 'pdf_infos_' . Files::hashFileAttributes($pdf); - return Cache::rememberForever($cacheKey, function () use ($pdf) { + return Cache::getRepository()->rememberForever($cacheKey, function () use ($pdf) { $fwstk = new FWSTK(); $fwstk->setArg('--input ' . $pdf); $fwstk->setArg('--infos');