Skip to content

Commit 34a51d2

Browse files
committed
Merge pull request #161 from AydinHassan/hotfix/deploy-command
Fix DeployCommand to work with EventManager
2 parents 705953f + e1988df commit 34a51d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/MagentoHackathon/Composer/Magento/Command/DeployCommand.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use MagentoHackathon\Composer\Magento\Deploy\Manager\Entry;
1010
use MagentoHackathon\Composer\Magento\DeployManager;
11+
use MagentoHackathon\Composer\Magento\Event\EventManager;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Input\InputOption;
1314
use Symfony\Component\Console\Output\OutputInterface;
@@ -51,8 +52,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
5152
*/
5253
$moduleInstaller = $im->getInstaller("magento-module");
5354

55+
$eventManager = new EventManager;
56+
$deployManager = new DeployManager($eventManager);
5457

55-
$deployManager = new DeployManager( $this->getIO() );
58+
$io = $this->getIo();
59+
if ($io->isDebug()) {
60+
$eventManager->listen('pre-package-deploy', function(PackageDeployEvent $event) use ($io) {
61+
$io->write('Start magento deploy for ' . $event->getDeployEntry()->getPackageName());
62+
});
63+
}
5664

5765
$extra = $composer->getPackage()->getExtra();
5866
$sortPriority = isset($extra['magento-deploy-sort-priority']) ? $extra['magento-deploy-sort-priority'] : array();

0 commit comments

Comments
 (0)