Skip to content

Commit

Permalink
Merge pull request #16 from saphaljha/2.2-develop-PR-port-19751
Browse files Browse the repository at this point in the history
[Backport] Fixed magento#19605 Don't static compile disabled modules
  • Loading branch information
saphaljha authored Dec 22, 2018
2 parents bb38593 + ea72dfe commit a6926fc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/code/Magento/Deploy/Collector/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Magento\Deploy\Source\SourcePool;
use Magento\Deploy\Package\Package;
use Magento\Deploy\Package\PackageFactory;
use Magento\Framework\Module\Manager;
use Magento\Framework\View\Asset\PreProcessor\FileNameResolver;

/**
Expand Down Expand Up @@ -43,6 +44,9 @@ class Collector implements CollectorInterface
* @var PackageFactory
*/
private $packageFactory;

/** @var \Magento\Framework\Module\Manager */
private $moduleManager;

/**
* Default values for package primary identifiers
Expand All @@ -65,11 +69,14 @@ class Collector implements CollectorInterface
public function __construct(
SourcePool $sourcePool,
FileNameResolver $fileNameResolver,
PackageFactory $packageFactory
PackageFactory $packageFactory,
Manager $moduleManager = null
) {
$this->sourcePool = $sourcePool;
$this->fileNameResolver = $fileNameResolver;
$this->packageFactory = $packageFactory;
$this->moduleManager = $moduleManager ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Module\Manager::class);
}

/**
Expand All @@ -81,6 +88,9 @@ public function collect()
foreach ($this->sourcePool->getAll() as $source) {
$files = $source->get();
foreach ($files as $file) {
if ($file->getModule() && !$this->moduleManager->isEnabled($file->getModule())) {
continue;
}
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
$params = [
'area' => $file->getArea(),
Expand Down

0 comments on commit a6926fc

Please sign in to comment.