/**
  * init the DeployManagers
  *
  * @param Composer    $composer
  * @param IOInterface $io
  */
 protected function initDeployManager(Composer $composer, IOInterface $io, EventManager $eventManager)
 {
     $this->deployManagers['core'] = new DeployManager($eventManager);
     $this->deployManagers['module'] = new DeployManager($eventManager);
     $this->deployManagers['module']->setSortPriority($this->getSortPriority($composer));
     if ($this->config->hasAutoAppendGitignore()) {
         $gitIgnoreLocation = sprintf('%s/.gitignore', $this->config->getMagentoRootDir());
         $eventManager->listen('post-package-deploy', new GitIgnoreListener(new GitIgnore($gitIgnoreLocation)));
     }
     if ($this->io->isDebug()) {
         $eventManager->listen('pre-package-deploy', function (PackageDeployEvent $event) use($io) {
             $io->write('Start magento deploy for ' . $event->getDeployEntry()->getPackageName());
         });
     }
 }
Example #2
0
 protected function applyEvents(EventManager $eventManager)
 {
     if ($this->config->hasAutoAppendGitignore()) {
         $gitIgnoreLocation = sprintf('%s/.gitignore', $this->config->getMagentoRootDir());
         $gitIgnore = new GitIgnoreListener(new GitIgnore($gitIgnoreLocation));
         $eventManager->listen('post-package-deploy', [$gitIgnore, 'addNewInstalledFiles']);
         $eventManager->listen('post-package-uninstall', [$gitIgnore, 'removeUnInstalledFiles']);
     }
     $io = $this->io;
     if ($this->io->isDebug()) {
         $eventManager->listen('pre-package-deploy', function (PackageDeployEvent $event) use($io) {
             $io->write('Start magento deploy for ' . $event->getDeployEntry()->getPackageName());
         });
     }
 }