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
magento2-base
setup
src
Magento
Setup
Fixtures
FixtureConfig.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Setup\Fixtures
;
8
9
use
Magento\Framework\Xml\Parser
;
10
14
class
FixtureConfig
15
{
19
private
$config;
20
24
private
$parser;
25
29
public
function
__construct
(
Parser
$parser)
30
{
31
$this->parser = $parser;
32
}
33
42
public
function
loadConfig
($filename)
43
{
44
if
(!
is_readable
($filename)) {
45
throw
new \Exception(
"Profile configuration file `{$filename}` is not readable or does not exists."
);
46
}
47
$this->parser->getDom()->load($filename);
48
$this->parser->getDom()->xinclude();
49
$this->config = $this->parser->xmlToArray();
50
$this->config[
'config'
][
'profile'
][
'di'
] = dirname($filename) .
'/'
51
. (isset($this->config[
'config'
][
'profile'
][
'di'
])
52
? $this->config[
'config'
][
'profile'
][
'di'
]
53
:
'../../config/di.xml'
54
);
55
}
56
65
public
function
getValue
($key, $default =
null
)
66
{
67
return
isset($this->config[
'config'
][
'profile'
][$key]) ?
68
(
69
// Work around for how attributes are handled in the XML parser when injected via xinclude due to the
70
// files existing outside of the current working directory.
71
isset($this->config[
'config'
][
'profile'
][$key][
'_value'
]) ?
72
$this->config[
'config'
][
'profile'
][$key][
'_value'
] : $this->config[
'config'
][
'profile'
][$key]
73
) : $default;
74
}
75
}
Magento\Setup\Fixtures\FixtureConfig
Definition:
FixtureConfig.php:14
Magento\Setup\Module\I18n\Parser
Magento\Framework\Xml\Parser
Definition:
Parser.php:8
Magento\Setup\Fixtures\FixtureConfig\__construct
__construct(Parser $parser)
Definition:
FixtureConfig.php:29
Magento\Setup\Fixtures\FixtureConfig\loadConfig
loadConfig($filename)
Definition:
FixtureConfig.php:42
Magento\Setup\Fixtures
Definition:
FixtureModelTest.php:7
Magento\Setup\Fixtures\FixtureConfig\getValue
getValue($key, $default=null)
Definition:
FixtureConfig.php:65
Magento\Setup\Fixtures\is_readable
is_readable($filename)
Definition:
FixtureConfigTest.php:74