Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
View
Asset
RepositoryMap.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Asset
;
7
8
use
Magento\Framework\App\Filesystem\DirectoryList
;
9
use
Magento\Framework\Filesystem
;
10
use
Magento\Framework\View\DesignInterface
;
11
15
class
RepositoryMap
16
{
25
const
MAP_NAME
=
'map.json'
;
26
34
const
RESULT_MAP_NAME
=
'result_map.json'
;
35
43
const
REQUIRE_JS_MAP_NAME
=
'requirejs-map.js'
;
44
48
private
$design;
49
53
private
$filesystem;
54
58
private
$maps = [];
59
65
public
function
__construct
(
DesignInterface
$design,
Filesystem
$filesystem)
66
{
67
$this->design = $design;
68
$this->filesystem =
$filesystem
;
69
}
70
76
public
function
getMap($fileId, array
$params
)
77
{
78
$area
=
$params
[
'area'
];
79
$locale
=
$params
[
'locale'
];
80
$themePath = isset(
$params
[
'theme'
]) ?
$params
[
'theme'
] : $this->design->getThemePath(
$params
[
'themeModel'
]);
81
82
$path
=
"$area/$themePath/$locale/"
.
self::MAP_NAME
;
83
if
(!isset($this->maps[
$path
])) {
84
$this->maps[
$path
] = [];
86
$staticDir = $this->filesystem->getDirectoryRead(
DirectoryList::STATIC_VIEW
);
87
if
($staticDir->isFile(
$path
)) {
88
$map
= $staticDir->readFile(
$path
);
89
if
(
$map
) {
90
$this->maps[
$path
] = json_decode(
$map
,
true
);
91
}
92
}
93
}
94
95
if
(isset($this->maps[
$path
][$fileId])) {
96
return
$this->maps[
$path
][$fileId];
97
}
98
return
[];
99
}
100
}
Magento\Framework\App\Filesystem\DirectoryList\STATIC_VIEW
const STATIC_VIEW
Definition:
DirectoryList.php:53
Magento\Framework\Filesystem
Definition:
Filesystem.php:16
$map
$map
Definition:
classmap_generator.php:167
Magento\Framework\Filesystem
Magento\Framework\View\Asset\$locale
$locale
Definition:
Asset.php:40
Magento\Framework\View\Asset\RepositoryMap\__construct
__construct(DesignInterface $design, Filesystem $filesystem)
Definition:
RepositoryMap.php:65
Magento\Framework\View\Asset\RepositoryMap\RESULT_MAP_NAME
const RESULT_MAP_NAME
Definition:
RepositoryMap.php:34
Magento\Framework\View\Asset\$area
$area
Definition:
Asset.php:30
Magento\Framework\View\Asset
Definition:
AssetInterface.php:6
Magento\Framework\View\Asset\RepositoryMap\REQUIRE_JS_MAP_NAME
const REQUIRE_JS_MAP_NAME
Definition:
RepositoryMap.php:43
Magento\Framework\App\Filesystem\DirectoryList
Definition:
DirectoryList.php:13
$params
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition:
website.php:18
Magento\Framework\View\DesignInterface
Definition:
DesignInterface.php:11
$filesystem
$filesystem
Definition:
validate_image.php:10
Magento\Framework\View\Asset\RepositoryMap\MAP_NAME
const MAP_NAME
Definition:
RepositoryMap.php:25
Magento\Framework\View\Asset\RepositoryMap
Definition:
RepositoryMap.php:15
$path
$path
Definition:
import_with_filesystem_images.php:14