/** * Returns the strategy class used for deployment * * @param \Composer\Package\PackageInterface $package * @param string $strategy * @return \MagentoHackathon\Composer\Magento\Deploystrategy\DeploystrategyAbstract */ public function getDeployStrategy(PackageInterface $package, $strategy = null) { if (null === $strategy) { $strategy = $this->_deployStrategy; } $moduleSpecificDeployStrategys = $this->composer->getPackage()->getExtra(); if (isset($moduleSpecificDeployStrategys['magento-deploystrategy-overwrite'])) { $moduleSpecificDeployStrategys = $moduleSpecificDeployStrategys['magento-deploystrategy-overwrite']; if (isset($moduleSpecificDeployStrategys[$package->getName()])) { $strategy = $moduleSpecificDeployStrategys[$package->getName()]; } } $targetDir = $this->getTargetDir(); $sourceDir = $this->getSourceDir($package); switch ($strategy) { case 'copy': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Copy($sourceDir, $targetDir); break; case 'link': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Link($sourceDir, $targetDir); break; case 'none': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\None($sourceDir, $targetDir); break; case 'symlink': default: $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Symlink($sourceDir, $targetDir); } // Inject isForced setting from extra config $impl->setIsForced($this->isForced); return $impl; }
/** * Returns the strategy class used for deployment * * @param \Composer\Package\PackageInterface $package * @param string $strategy * @return \MagentoHackathon\Composer\Magento\Deploystrategy\DeploystrategyAbstract */ public function getDeployStrategy(PackageInterface $package, $strategy = null) { if (null === $strategy) { $strategy = $this->_deployStrategy; } $extra = $this->composer->getPackage()->getExtra(); if (isset($extra['magento-deploystrategy-overwrite'])) { $moduleSpecificDeployStrategys = $this->transformArrayKeysToLowerCase($extra['magento-deploystrategy-overwrite']); if (isset($moduleSpecificDeployStrategys[$package->getName()])) { $strategy = $moduleSpecificDeployStrategys[$package->getName()]; } } $moduleSpecificDeployIgnores = array(); if (isset($extra['magento-deploy-ignore'])) { $extra['magento-deploy-ignore'] = $this->transformArrayKeysToLowerCase($extra['magento-deploy-ignore']); if (isset($extra['magento-deploy-ignore']["*"])) { $moduleSpecificDeployIgnores = $extra['magento-deploy-ignore']["*"]; } if (isset($extra['magento-deploy-ignore'][$package->getName()])) { $moduleSpecificDeployIgnores = array_merge($moduleSpecificDeployIgnores, $extra['magento-deploy-ignore'][$package->getName()]); } } if ($package->getType() === 'magento-core') { $strategy = 'copy'; } $targetDir = $this->getTargetDir(); $sourceDir = $this->getSourceDir($package); switch ($strategy) { case 'copy': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Copy($sourceDir, $targetDir); break; case 'link': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Link($sourceDir, $targetDir); break; case 'none': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\None($sourceDir, $targetDir); break; case 'symlink': default: $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Symlink($sourceDir, $targetDir); } // Inject isForced setting from extra config $impl->setIsForced($this->isForced); $impl->setIgnoredMappings($moduleSpecificDeployIgnores); return $impl; }
/** * Returns the strategy class used for deployment * * @param \Composer\Package\PackageInterface $package * @param string $strategy * @return \MagentoHackathon\Composer\Magento\Deploystrategy\DeploystrategyAbstract */ public function getDeployStrategy(PackageInterface $package, $strategy = null) { if (null === $strategy) { $strategy = $this->_deployStrategy; } $targetDir = $this->getTargetDir(); $sourceDir = $this->getSourceDir($package); switch ($strategy) { case 'copy': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Copy($sourceDir, $targetDir); break; case 'link': $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Link($sourceDir, $targetDir); break; case 'symlink': default: $impl = new \MagentoHackathon\Composer\Magento\Deploystrategy\Symlink($sourceDir, $targetDir); } // Inject isForced setting from extra config $impl->setIsForced($this->isForced); return $impl; }