-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #295 from magento-extensibility/MAGETWO-47639-comp…
…iler-2.0 [Extensibility] Magetwo 47639 compiler 2.0
- Loading branch information
Showing
12 changed files
with
257 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
setup/src/Magento/Setup/Module/Di/Code/Scanner/ConfigurationScanner.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Setup\Module\Di\Code\Scanner; | ||
|
||
use Magento\Framework\App\Area; | ||
|
||
class ConfigurationScanner | ||
{ | ||
/** | ||
* ConfigurationScanner constructor. | ||
* | ||
* @param \Magento\Framework\App\Config\FileResolver $fileResolver | ||
* @param \Magento\Framework\App\AreaList $areaList | ||
*/ | ||
public function __construct( | ||
\Magento\Framework\App\Config\FileResolver $fileResolver, | ||
\Magento\Framework\App\AreaList $areaList | ||
) { | ||
$this->fileResolver = $fileResolver; | ||
$this->areaList = $areaList; | ||
} | ||
|
||
/** | ||
* Scan configuration files | ||
* | ||
* @param string $fileName | ||
* | ||
* @return array array of paths to the configuration files | ||
*/ | ||
public function scan($fileName) | ||
{ | ||
$files = []; | ||
$areaCodes = array_merge( | ||
['primary', Area::AREA_GLOBAL], | ||
$this->areaList->getCodes() | ||
); | ||
foreach ($areaCodes as $area) { | ||
$files = array_merge_recursive( | ||
$files, | ||
$this->fileResolver->get($fileName, $area)->toArray() | ||
); | ||
} | ||
return array_keys($files); | ||
} | ||
} |
Oops, something went wrong.