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
Element
UiComponent
Config
FileCollector
AggregatedFileCollector.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\View\Element\UiComponent\Config\FileCollector
;
7
8
use
Magento\Framework\Filesystem\Directory\ReadFactory
;
9
use
Magento\Framework\View\DesignInterface
;
10
use
Magento\Framework\View\File\CollectorInterface
;
11
use
Magento\Framework\View\Element\UiComponent\Config\FileCollectorInterface
;
12
16
class
AggregatedFileCollector
implements
FileCollectorInterface
17
{
23
protected
$searchPattern
;
24
28
protected
$collectorAggregated
;
29
33
protected
$design
;
34
38
protected
$readFactory
;
39
48
public
function
__construct
(
49
CollectorInterface
$collectorAggregated
,
50
DesignInterface
$design
,
51
ReadFactory
$readFactory
,
52
$searchPattern
=
null
53
) {
54
$this->searchPattern =
$searchPattern
;
55
$this->collectorAggregated =
$collectorAggregated
;
56
$this->design =
$design
;
57
$this->readFactory =
$readFactory
;
58
}
59
67
public
function
collectFiles
(
$searchPattern
=
null
)
68
{
69
$result
= [];
70
if
(
$searchPattern
===
null
) {
71
$searchPattern
=
$this->searchPattern
;
72
}
73
if
(
$searchPattern
===
null
) {
74
throw
new \Exception(
'Search pattern cannot be empty.'
);
75
}
76
$files
= $this->collectorAggregated->getFiles($this->design->getDesignTheme(),
$searchPattern
);
77
foreach
(
$files
as $file) {
78
$fullFileName = $file->getFilename();
79
$fileDir = dirname($fullFileName);
80
$fileName
= basename($fullFileName);
81
$dirRead = $this->readFactory->create($fileDir);
82
$result
[$fullFileName] = $dirRead->readFile(
$fileName
);
83
}
84
85
return
$result
;
86
}
87
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\View\Element\UiComponent\Config\FileCollectorInterface
Definition:
FileCollectorInterface.php:11
Magento\Framework\View\Element\UiComponent\Config\FileCollector
Definition:
AggregatedFileCollector.php:6
Magento\Framework\View\File\CollectorInterface
Definition:
CollectorInterface.php:16
Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector\__construct
__construct(CollectorInterface $collectorAggregated, DesignInterface $design, ReadFactory $readFactory, $searchPattern=null)
Definition:
AggregatedFileCollector.php:48
Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector\$design
$design
Definition:
AggregatedFileCollector.php:33
Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector\$readFactory
$readFactory
Definition:
AggregatedFileCollector.php:38
Magento\Framework\Filesystem\Directory\ReadFactory
Definition:
ReadFactory.php:10
$fileName
$fileName
Definition:
translate.phtml:15
Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector\$collectorAggregated
$collectorAggregated
Definition:
AggregatedFileCollector.php:28
Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector\$searchPattern
$searchPattern
Definition:
AggregatedFileCollector.php:23
Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector
Definition:
AggregatedFileCollector.php:16
Magento\Framework\View\DesignInterface
Definition:
DesignInterface.php:11
$files
foreach($appDirs as $dir) $files
Definition:
app_dirs_rollback.php:18
Magento\Framework\View\Element\UiComponent\Config\FileCollector\AggregatedFileCollector\collectFiles
collectFiles($searchPattern=null)
Definition:
AggregatedFileCollector.php:67