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 14
14
use Magento \Framework \Filesystem \Directory \ReadInterface ;
15
15
use Magento \Framework \Exception \NoSuchEntityException ;
16
16
use Magento \Framework \Filesystem \ExtendedDriverInterface ;
17
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
17
18
use Magento \Store \Model \StoreManagerInterface ;
18
19
19
20
/**
20
21
* Class FileInfo
21
22
*
22
23
* Provides information about requested file
23
24
*/
24
- class FileInfo
25
+ class FileInfo implements ResetAfterRequestInterface
25
26
{
26
27
/**
27
28
* Path in /pub/media directory
@@ -31,12 +32,12 @@ class FileInfo
31
32
/**
32
33
* @var Filesystem
33
34
*/
34
- private $ filesystem ;
35
+ private readonly Filesystem $ filesystem ;
35
36
36
37
/**
37
38
* @var Mime
38
39
*/
39
- private $ mime ;
40
+ private readonly Mime $ mime ;
40
41
41
42
/**
42
43
* @var WriteInterface
@@ -56,7 +57,7 @@ class FileInfo
56
57
/**
57
58
* @var \Magento\Store\Model\StoreManagerInterface
58
59
*/
59
- private $ storeManager ;
60
+ private readonly StoreManagerInterface $ storeManager ;
60
61
61
62
/**
62
63
* @param Filesystem $filesystem
@@ -73,6 +74,16 @@ public function __construct(
73
74
$ this ->storeManager = $ storeManager ;
74
75
}
75
76
77
+ /**
78
+ * @inheritDoc
79
+ */
80
+ public function _resetState (): void
81
+ {
82
+ $ this ->mediaDirectory = null ;
83
+ $ this ->baseDirectory = null ;
84
+ $ this ->pubDirectory = null ;
85
+ }
86
+
76
87
/**
77
88
* Get WriteInterface instance
78
89
*
Original file line number Diff line number Diff line change 8
8
namespace Magento \RemoteStorage \Driver \Adapter \Cache ;
9
9
10
10
use Magento \Framework \App \CacheInterface as MagentoCacheInterface ;
11
+ use Magento \Framework \ObjectManager \ResetAfterRequestInterface ;
11
12
use Magento \Framework \Serialize \SerializerInterface ;
12
13
use Magento \RemoteStorage \Driver \Adapter \PathUtil ;
13
14
14
15
/**
15
16
* Generic cache implementation for filesystem storage.
16
17
*/
17
- class Generic implements CacheInterface
18
+ class Generic implements CacheInterface, ResetAfterRequestInterface
18
19
{
19
20
/**
20
21
* @var array
@@ -66,6 +67,15 @@ public function __construct(
66
67
$ this ->pathUtil = $ pathUtil ;
67
68
}
68
69
70
+ /**
71
+ * @inheritDoc
72
+ */
73
+ public function _resetState (): void
74
+ {
75
+ $ this ->cacheData = [];
76
+ $ this ->cachePathPurgeQueue = [];
77
+ }
78
+
69
79
/**
70
80
* @inheritdoc
71
81
*/
You can’t perform that action at this time.
0 commit comments