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
Setup
SampleData
FixtureManager.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Setup\SampleData
;
7
8
use
Magento\Framework\Component\ComponentRegistrar
;
9
use
Magento\Framework\Filesystem
;
10
use
Magento\Framework\Filesystem\Directory\ReadInterface
;
11
12
class
FixtureManager
13
{
17
private
$componentRegistrar;
18
24
protected
$_modulesDirectory
;
25
29
protected
$_string
;
30
35
public
function
__construct
(
ComponentRegistrar
$componentRegistrar, \
Magento
\Framework\Stdlib\StringUtils $string)
36
{
37
$this->componentRegistrar =
$componentRegistrar
;
38
$this->_string = $string;
39
}
40
46
public
function
getFixture
($fileId)
47
{
48
list($moduleName, $filePath) = \Magento\Framework\View\Asset\Repository::extractModule(
49
$this->
normalizePath
($fileId)
50
);
51
return
$this->componentRegistrar->getPath(
ComponentRegistrar::MODULE
, $moduleName) .
'/'
. $filePath;
52
}
53
62
public
static
function
normalizePath
(
$path
)
63
{
64
$parts = explode(
'/'
,
$path
);
65
$result
= [];
66
67
foreach
($parts as $part) {
68
if
(
'..'
=== $part) {
69
if
(!count(
$result
) || (
$result
[count(
$result
) - 1] ==
'..'
)) {
70
$result
[] = $part;
71
}
else
{
72
array_pop(
$result
);
73
}
74
}
elseif
(
'.'
!== $part) {
75
$result
[] = $part;
76
}
77
}
78
return
implode(
'/'
,
$result
);
79
}
80
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\Setup\SampleData
Definition:
Context.php:6
Magento\Framework\Setup\SampleData\FixtureManager\normalizePath
static normalizePath($path)
Definition:
FixtureManager.php:62
$componentRegistrar
$componentRegistrar
Definition:
bootstrap.php:23
elseif
elseif(isset( $params[ 'redirect_parent']))
Definition:
iframe.phtml:17
Magento\Framework\Filesystem
Magento\Framework\Filesystem\Directory\ReadInterface
Definition:
ReadInterface.php:12
Magento\Framework\Setup\SampleData\FixtureManager\__construct
__construct(ComponentRegistrar $componentRegistrar, \Magento\Framework\Stdlib\StringUtils $string)
Definition:
FixtureManager.php:35
Magento\Framework\Component\ComponentRegistrar\MODULE
const MODULE
Definition:
ComponentRegistrar.php:21
Magento\Framework\Setup\SampleData\FixtureManager\$_modulesDirectory
$_modulesDirectory
Definition:
FixtureManager.php:24
Magento
Magento\Framework\Setup\SampleData\FixtureManager\getFixture
getFixture($fileId)
Definition:
FixtureManager.php:46
Magento\Framework\Component\ComponentRegistrar
Definition:
ComponentRegistrar.php:16
Magento\Framework\Setup\SampleData\FixtureManager
Definition:
FixtureManager.php:12
$path
$path
Definition:
import_with_filesystem_images.php:14
Magento\Framework\Setup\SampleData\FixtureManager\$_string
$_string
Definition:
FixtureManager.php:29