12 use Composer\IO\IOInterface;
43 private $highPriority = [
44 'magento/magento2-base' => 10
54 $this->packages[] = $package;
59 $this->sortPriority = $priorities;
75 $aPriority = $this->getPackagePriority($a);
76 $bPriority = $this->getPackagePriority($b);
77 if ($aPriority == $bPriority) {
80 return ($aPriority > $bPriority) ? -1 : 1;
87 public function doDeploy()
92 foreach ($this->packages as $package) {
93 if ($this->io->isDebug()) {
94 $this->io->write(
'start magento deploy for ' . $package->getPackageName());
97 $package->getDeployStrategy()->deploy();
98 }
catch (\ErrorException $e) {
99 if ($this->io->isDebug()) {
100 $this->io->write($e->getMessage());
112 private function getPackagePriority(Entry $package)
115 $maxPriority = max(array_merge($this->sortPriority, [100, 101]));
117 if (isset($this->highPriority[$package->getPackageName()])) {
118 $packagePriority = $this->highPriority[$package->getPackageName()];
119 $result = intval($maxPriority) + intval($packagePriority);
120 }
elseif (isset($this->sortPriority[$package->getPackageName()])) {
121 $result = $this->sortPriority[$package->getPackageName()];
122 }
elseif ($package->getDeployStrategy() instanceof Copy) {
elseif(isset( $params[ 'redirect_parent']))
__construct(IOInterface $io)
addPackage(Entry $package)
setSortPriority($priorities)