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
Module
ModuleList.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Module
;
7
8
use
Magento\Framework\App\DeploymentConfig
;
9
use
Magento\Framework\Config\ConfigOptionsListConstants
;
10
17
class
ModuleList
implements
ModuleListInterface
18
{
24
private
$config;
25
31
private
$loader;
32
40
private
$configData;
41
47
private
$enabled;
48
55
public
function
__construct
(
DeploymentConfig
$config,
ModuleList
\Loader $loader)
56
{
57
$this->config =
$config
;
58
$this->loader =
$loader
;
59
}
60
69
public
function
getAll
()
70
{
71
if
(
null
=== $this->enabled) {
72
$all = $this->loader->load();
73
if
(empty($all)) {
74
return
[];
// don't record erroneous value into memory
75
}
76
$this->enabled = [];
77
foreach
($all as $key =>
$value
) {
78
if
($this->
has
($key)) {
79
$this->enabled[$key] =
$value
;
80
}
81
}
82
}
83
return
$this->enabled;
84
}
85
90
public
function
getOne
(
$name
)
91
{
92
$enabled = $this->
getAll
();
93
return
$enabled[
$name
] ??
null
;
94
}
95
99
public
function
getNames
()
100
{
101
$this->loadConfigData();
102
if
(!$this->configData) {
103
return
[];
104
}
105
$result
= array_keys(array_filter($this->configData));
106
return
$result
;
107
}
108
112
public
function
has
(
$name
)
113
{
114
$this->loadConfigData();
115
if
(!$this->configData) {
116
return
false
;
117
}
118
return
!empty($this->configData[
$name
]);
119
}
120
126
public
function
isModuleInfoAvailable
()
127
{
128
$this->loadConfigData();
129
if
($this->configData) {
130
return
true
;
131
}
132
return
false
;
133
}
134
140
private
function
loadConfigData()
141
{
142
$this->config->resetData();
143
if
(
null
=== $this->configData &&
null
!== $this->config->get(
ConfigOptionsListConstants::KEY_MODULES
)) {
144
$this->configData = $this->config->get(
ConfigOptionsListConstants::KEY_MODULES
);
145
}
146
}
147
}
Magento\Framework\Module\ModuleList\getAll
getAll()
Definition:
ModuleList.php:69
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\Module\ModuleListInterface
Definition:
ModuleListInterface.php:14
Magento\Framework\Module\ModuleList\getOne
getOne($name)
Definition:
ModuleList.php:90
$config
$config
Definition:
fraud_order.php:17
Magento\Framework\App\DeploymentConfig
Definition:
DeploymentConfig.php:17
Magento\Framework\Module\ModuleList\__construct
__construct(DeploymentConfig $config, ModuleList\Loader $loader)
Definition:
ModuleList.php:55
$loader
$loader
Definition:
autoload.php:8
Magento\Framework\Config\ConfigOptionsListConstants\KEY_MODULES
const KEY_MODULES
Definition:
ConfigOptionsListConstants.php:128
Magento\Framework\Module
Definition:
ConflictChecker.php:6
Magento\Framework\Module\ModuleList
Definition:
ModuleList.php:17
$value
$value
Definition:
gender.phtml:16
Magento\Framework\Module\ModuleList\isModuleInfoAvailable
isModuleInfoAvailable()
Definition:
ModuleList.php:126
Magento\Framework\Config\ConfigOptionsListConstants
Definition:
ConfigOptionsListConstants.php:16
Magento\Framework\Module\ModuleList\has
has($name)
Definition:
ModuleList.php:112
Magento\Framework\Module\ModuleList\getNames
getNames()
Definition:
ModuleList.php:99
Magento\Framework\App\DeploymentConfig
Definition:
CommentParser.php:6
$name
if(!isset($_GET['name'])) $name
Definition:
log.php:14