Skip to content

Commit 7164ab1

Browse files
Merge branch '2.4-develop' into ACQE-6392
2 parents 1f58462 + b0c49b2 commit 7164ab1

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

app/code/Magento/Catalog/Model/Category/FileInfo.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
use Magento\Framework\Filesystem\Directory\ReadInterface;
1515
use Magento\Framework\Exception\NoSuchEntityException;
1616
use Magento\Framework\Filesystem\ExtendedDriverInterface;
17+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1718
use Magento\Store\Model\StoreManagerInterface;
1819

1920
/**
2021
* Class FileInfo
2122
*
2223
* Provides information about requested file
2324
*/
24-
class FileInfo
25+
class FileInfo implements ResetAfterRequestInterface
2526
{
2627
/**
2728
* Path in /pub/media directory
@@ -31,12 +32,12 @@ class FileInfo
3132
/**
3233
* @var Filesystem
3334
*/
34-
private $filesystem;
35+
private readonly Filesystem $filesystem;
3536

3637
/**
3738
* @var Mime
3839
*/
39-
private $mime;
40+
private readonly Mime $mime;
4041

4142
/**
4243
* @var WriteInterface
@@ -56,7 +57,7 @@ class FileInfo
5657
/**
5758
* @var \Magento\Store\Model\StoreManagerInterface
5859
*/
59-
private $storeManager;
60+
private readonly StoreManagerInterface $storeManager;
6061

6162
/**
6263
* @param Filesystem $filesystem
@@ -73,6 +74,16 @@ public function __construct(
7374
$this->storeManager = $storeManager;
7475
}
7576

77+
/**
78+
* @inheritDoc
79+
*/
80+
public function _resetState(): void
81+
{
82+
$this->mediaDirectory = null;
83+
$this->baseDirectory = null;
84+
$this->pubDirectory = null;
85+
}
86+
7687
/**
7788
* Get WriteInterface instance
7889
*

app/code/Magento/RemoteStorage/Driver/Adapter/Cache/Generic.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
namespace Magento\RemoteStorage\Driver\Adapter\Cache;
99

1010
use Magento\Framework\App\CacheInterface as MagentoCacheInterface;
11+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1112
use Magento\Framework\Serialize\SerializerInterface;
1213
use Magento\RemoteStorage\Driver\Adapter\PathUtil;
1314

1415
/**
1516
* Generic cache implementation for filesystem storage.
1617
*/
17-
class Generic implements CacheInterface
18+
class Generic implements CacheInterface, ResetAfterRequestInterface
1819
{
1920
/**
2021
* @var array
@@ -66,6 +67,15 @@ public function __construct(
6667
$this->pathUtil = $pathUtil;
6768
}
6869

70+
/**
71+
* @inheritDoc
72+
*/
73+
public function _resetState(): void
74+
{
75+
$this->cacheData = [];
76+
$this->cachePathPurgeQueue = [];
77+
}
78+
6979
/**
7080
* @inheritdoc
7181
*/

0 commit comments

Comments
 (0)