Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
PluginScanner.php
Go to the documentation of this file.
1 <?php
7 
9 {
16  public function collectEntities(array $files)
17  {
18  $pluginClassNames = [];
19  foreach ($files as $fileName) {
20  $dom = new \DOMDocument();
21  $dom->loadXML(file_get_contents($fileName));
22  $xpath = new \DOMXPath($dom);
24  foreach ($xpath->query('//type/plugin|//virtualType/plugin') as $node) {
25  $pluginTypeNode = $node->attributes->getNamedItem('type');
26  if ($pluginTypeNode !== null) {
27  $pluginClassNames[] = $pluginTypeNode->nodeValue;
28  }
29  }
30  }
31  return $pluginClassNames;
32  }
33 }
$fileName
Definition: translate.phtml:15
foreach($appDirs as $dir) $files