/** * @param PackageInterface $package * @param string $sourceDir * @return Parser * @throws \ErrorException */ public function make(PackageInterface $package, $sourceDir) { $parser = $this->parserFactory->make($package, $sourceDir); if ($this->config->hasPathMappingTranslations()) { $translations = $this->config->getPathMappingTranslations(); return new PathTranslationParser($parser, $translations); } return $parser; }
/** * @param PackageInterface $package * @param string $packageSourceDirectory * @return Entry */ public function make(PackageInterface $package, $packageSourceDirectory) { $entry = new Entry(); $entry->setPackageName($package->getName()); $strategy = $this->deploystrategyFactory->make($package, $packageSourceDirectory); $mappingParser = $this->parserFactory->make($package, $packageSourceDirectory); $strategy->setMappings($mappingParser->getMappings()); $entry->setDeployStrategy($strategy); return $entry; }
/** * @param PackageInterface $package * @param string $packageSourcePath * @return DeploystrategyAbstract */ public function make(PackageInterface $package, $packageSourcePath) { $strategyName = $this->config->getModuleSpecificDeployStrategy($package->getName()); $ns = '\\MagentoHackathon\\Composer\\Magento\\Deploystrategy\\'; $className = $ns . ucfirst($strategyName); if (!class_exists($className)) { $className = $ns . 'Symlink'; } $strategy = new $className($packageSourcePath, realpath($this->config->getMagentoRootDir())); $strategy->setIgnoredMappings($this->config->getModuleSpecificDeployIgnores($package->getName())); $strategy->setIsForced($this->config->getMagentoForceByPackageName($package->getName())); $mappingParser = $this->parserFactory->make($package, $packageSourcePath); $strategy->setMappings($mappingParser->getMappings()); return $strategy; }