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
Autoload
ClassMap.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\Framework\Autoload
;
9
10
class
ClassMap
11
{
17
protected
$_baseDir
;
18
28
protected
$_map
= [];
29
36
public
function
__construct
(
$baseDir
)
37
{
38
$this->_baseDir = realpath(
$baseDir
);
39
if
(!$this->_baseDir || !
is_dir
($this->_baseDir)) {
40
throw
new \InvalidArgumentException(
"Specified path is not a valid directory: '{$baseDir}'"
);
41
}
42
}
43
50
public
function
getFile
(
$class
)
51
{
52
if
(isset($this->_map[
$class
])) {
53
return
$this->_baseDir .
'/'
. $this->_map[
$class
];
54
}
55
return
false
;
56
}
57
64
public
function
addMap
(array
$map
)
65
{
66
$this->_map = array_merge($this->_map,
$map
);
67
return
$this;
68
}
69
76
public
function
load
(
$class
)
77
{
78
$file = $this->
getFile
(
$class
);
79
if
(file_exists($file)) {
80
include $file;
81
}
82
}
83
}
$map
$map
Definition:
classmap_generator.php:167
Magento\Framework\Autoload\ClassMap
Definition:
ClassMap.php:10
$baseDir
$baseDir
Definition:
autoload.php:9
Magento\Framework\Autoload\ClassMap\getFile
getFile($class)
Definition:
ClassMap.php:50
$class
$_option $_optionId $class
Definition:
date.phtml:13
Magento\Framework\Autoload\ClassMap\load
load($class)
Definition:
ClassMap.php:76
Magento\Framework\Autoload\ClassMap\__construct
__construct($baseDir)
Definition:
ClassMap.php:36
Magento\Framework\Autoload\ClassMap\addMap
addMap(array $map)
Definition:
ClassMap.php:64
Magento\Framework\Autoload\ClassMap\$_map
$_map
Definition:
ClassMap.php:28
Magento\Framework\Autoload\ClassMap\$_baseDir
$_baseDir
Definition:
ClassMap.php:17
Magento\Framework\Backup\is_dir
is_dir($path)
Definition:
io.php:14
Magento\Framework\Autoload
Definition:
AutoloaderInterface.php:6