File tree Expand file tree Collapse file tree 2 files changed +26
-5
lines changed
RemoteStorage/Driver/Adapter/Cache Expand file tree Collapse file tree 2 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 1414use Magento \Framework \Filesystem \Directory \ReadInterface ;
1515use Magento \Framework \Exception \NoSuchEntityException ;
1616use Magento \Framework \Filesystem \ExtendedDriverInterface ;
17+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
1718use 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 *
Original file line number Diff line number Diff line change 88namespace Magento \RemoteStorage \Driver \Adapter \Cache ;
99
1010use Magento \Framework \App \CacheInterface as MagentoCacheInterface ;
11+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
1112use Magento \Framework \Serialize \SerializerInterface ;
1213use 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 */
You can’t perform that action at this time.
0 commit comments