From 18aca733c3edf63379d140ebd430e2e51c531cbd Mon Sep 17 00:00:00 2001 From: Elhebert Date: Mon, 24 Mar 2025 21:05:33 +0100 Subject: [PATCH 1/2] add Symfony 7 support --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 7c386d55c..8eba30075 100644 --- a/composer.json +++ b/composer.json @@ -35,14 +35,14 @@ "doctrine/cache": "^1.0", "doctrine/collections": "^1.0", "exiftool/exiftool": "*", - "symfony/console": "^5 || ^6.2", - "symfony/css-selector": "^5 || ^6.2", - "symfony/dom-crawler": "^5 || ^6.2", - "symfony/process": "^5 || ^6", + "symfony/console": "^5 || ^6.2 || ^7.0", + "symfony/css-selector": "^5 || ^6.2 || ^7.0", + "symfony/dom-crawler": "^5 || ^6.2 || ^7.0", + "symfony/process": "^5 || ^6 || ^7.0", "ext-dom": "*", "cache/array-adapter": "^1.2", "ext-json": "*", - "symfony/monolog-bridge": "^5.4 || ^6.2" + "symfony/monolog-bridge": "^5.4 || ^6.2 || ^7.0" }, "suggest": { "jms/serializer": "To serialize tags", @@ -52,7 +52,7 @@ "jms/serializer": "~3", "phpunit/phpunit": "^9.6.7", "symfony/finder": "^5", - "symfony/yaml": "^5 || ^6" + "symfony/yaml": "^5 || ^6 || ^7.0" }, "autoload": { "psr-4": { From 56549e0e8a1d150743b860723f271c4e25536862 Mon Sep 17 00:00:00 2001 From: Elhebert Date: Tue, 25 Mar 2025 06:41:53 +0100 Subject: [PATCH 2/2] replace the deprecated doctrine/cache with symfony/cache --- composer.json | 5 ++--- lib/PHPExiftool/FileEntity.php | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 8eba30075..ee79b75f8 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,6 @@ ], "require": { "php": "^7.4 || ^8.2", - "doctrine/cache": "^1.0", "doctrine/collections": "^1.0", "exiftool/exiftool": "*", "symfony/console": "^5 || ^6.2 || ^7.0", @@ -40,9 +39,9 @@ "symfony/dom-crawler": "^5 || ^6.2 || ^7.0", "symfony/process": "^5 || ^6 || ^7.0", "ext-dom": "*", - "cache/array-adapter": "^1.2", "ext-json": "*", - "symfony/monolog-bridge": "^5.4 || ^6.2 || ^7.0" + "symfony/monolog-bridge": "^5.4 || ^6.2 || ^7.0", + "symfony/cache": "^5 || ^6.2 || ^7.0" }, "suggest": { "jms/serializer": "To serialize tags", diff --git a/lib/PHPExiftool/FileEntity.php b/lib/PHPExiftool/FileEntity.php index 89a3e2307..c929e11a3 100644 --- a/lib/PHPExiftool/FileEntity.php +++ b/lib/PHPExiftool/FileEntity.php @@ -12,7 +12,6 @@ namespace PHPExiftool; -use Cache\Adapter\PHPArray\ArrayCachePool; use DOMDocument; use Exception; use IteratorAggregate; @@ -20,6 +19,7 @@ use PHPExiftool\Driver\Value\ValueInterface; use Psr\Cache\CacheItemPoolInterface; use Psr\Cache\InvalidArgumentException; +use Symfony\Component\Cache\Adapter\ArrayAdapter; /** @@ -51,7 +51,7 @@ public function __construct(string $file, DOMDocument $dom, RDFParser $parser) // $this->dom = $dom; $this->file = $file; - $this->cache = new ArrayCachePool(); + $this->cache = new ArrayAdapter(); $this->parser = $parser->open($dom->saveXML());