File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
lib/internal/Magento/Framework/View/Asset Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ class Merged implements \Iterator
40
40
*/
41
41
protected $ contentType ;
42
42
43
+ /**
44
+ * @var StorageInterface
45
+ */
46
+ private $ versionStorage ;
47
+
43
48
/**
44
49
* @var bool
45
50
*/
@@ -56,11 +61,13 @@ public function __construct(
56
61
\Psr \Log \LoggerInterface $ logger ,
57
62
MergeStrategyInterface $ mergeStrategy ,
58
63
\Magento \Framework \View \Asset \Repository $ assetRepo ,
64
+ \Magento \Framework \App \View \Deployment \Version \StorageInterface $ versionStorage ,
59
65
array $ assets
60
66
) {
61
67
$ this ->logger = $ logger ;
62
68
$ this ->mergeStrategy = $ mergeStrategy ;
63
69
$ this ->assetRepo = $ assetRepo ;
70
+ $ this ->versionStorage = $ versionStorage ;
64
71
65
72
if (!$ assets ) {
66
73
throw new \InvalidArgumentException ('At least one asset has to be passed for merging. ' );
@@ -116,6 +123,12 @@ private function createMergedAsset(array $assets)
116
123
$ paths [] = $ asset ->getPath ();
117
124
}
118
125
$ paths = array_unique ($ paths );
126
+
127
+ $ version =$ this ->versionStorage ->load ();
128
+ if ($ version ) {
129
+ $ paths []=$ version ;
130
+ }
131
+
119
132
$ filePath = md5 (implode ('| ' , $ paths )) . '. ' . $ this ->contentType ;
120
133
return $ this ->assetRepo ->createArbitrary ($ filePath , self ::getRelativeDir ());
121
134
}
You can’t perform that action at this time.
0 commit comments