/** * {@inheritDoc} */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $this->installCode($package); if (!$repo->hasPackage($package)) { $repo->addPackage(clone $package); } }
public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $this->initializeVendorDir(); $downloadPath = $this->getInstallPath($package); // remove the binaries if it appears the package files are missing if (!is_readable($downloadPath) && $repo->hasPackage($package)) { $this->binaryInstaller->removeBinaries($package); } // Save .modman folder temporally to recover it after the source code is installed. if ($package->getType() === MagentoInstaller::MAGENTO_SOURCE && is_dir($downloadPath . '/.modman')) { $this->filesystem->copyThenRemove($downloadPath . '/.modman', $this->tmpModmanBackup); } $this->installCode($package); $this->binaryInstaller->installBinaries($package, $this->vendorDir); if (!$repo->hasPackage($package)) { $repo->addPackage(clone $package); } if ($package->getType() === MagentoInstaller::MAGENTO_SOURCE) { // remove git $this->filesystem->removeDirectory($downloadPath . '/.git'); // Recover modman temporal backup after the magento source installation if (is_dir($this->tmpModmanBackup)) { $this->filesystem->copyThenRemove($this->tmpModmanBackup, $downloadPath . '/.modman'); } // copy .modman directory from backup dir when exist if (is_dir($this->backupPath . '/.modman')) { $this->filesystem->copyThenRemove($this->backupPath . '/.modman', $downloadPath . '/.modman'); } } }
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if (!$repo->hasPackage($initial)) { throw new \InvalidArgumentException('Package is not installed: ' . $initial); } $repo->removePackage($initial); $repo->addPackage(clone $target); }
/** * {@inheritDoc} */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { $this->installCode($package); if (!$repo->hasPackage($package)) { $repo->addPackage(clone $package); } $this->filesystem->ensureDirectoryExists('data'); $this->filesystem->ensureDirectoryExists('local_data'); }
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if (!$repo->hasPackage($initial)) { throw new \InvalidArgumentException('Package is not installed: ' . $initial); } $this->initializeVendorDir(); $this->removeBinaries($initial); $this->updateCode($initial, $target); $this->installBinaries($target); $repo->removePackage($initial); if (!$repo->hasPackage($target)) { $repo->addPackage(clone $target); } }
/** * {@inheritDoc} */ public function install(InstalledRepositoryInterface $repo, PackageInterface $package) { // Debug $this->debug = $this->isDebug($package); // Composer stuff $this->initializeVendorDir(); $downloadPath = $this->getInstallPath($package); if (!is_readable($downloadPath) && $repo->hasPackage($package)) { $this->removeBinaries($package); } if (!$repo->hasPackage($package)) { $repo->addPackage(clone $package); } $this->downloadAndExtractFile($package); }
public function updateCode(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if (!$repo->hasPackage($initial)) { throw new \InvalidArgumentException('Package is not installed: ' . $initial); } if ($initial->getInstallationSource() == 'source' && $initial->getSourceType() == 'git' && $target->getSourceType() == 'git') { $this->downloadManager->update($initial, $target, $this->getInstallPath($target)); } else { $this->installCode($target); } $repo->removePackage($initial); if (!$repo->hasPackage($target)) { $repo->addPackage(clone $target); } }
/** * Updates a package * * @param \Composer\Repository\InstalledRepositoryInterface $repo * @param \Composer\Package\PackageInterface $initial * @param \Composer\Package\PackageInterface $target * @throws \InvalidArgumentException */ public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) { if (!$repo->hasPackage($initial)) { throw new CoreInstaller\PackageNotInstalledException($initial); } $this->getDriver()->update($initial, $target); $repo->removePackage($initial); if (!$repo->hasPackage($target)) { $repo->addPackage(clone $target); } }
/** * Updates specific package. * * @param \Composer\Repository\InstalledRepositoryInterface $repo repository in which to check * @param \Composer\Package\PackageInterface $initial already installed package version * @param \Composer\Package\PackageInterface $target updated version */ public function update(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $initial, \Composer\Package\PackageInterface $target) { $this->getTypo3OrgService->addDistToPackage($initial); $this->getTypo3OrgService->addDistToPackage($target); if ($this->filesystem->someFilesExist($this->symlinks)) { $this->filesystem->removeSymlinks($this->symlinks); } $this->updateCode($initial, $target); $this->filesystem->establishSymlinks($this->symlinks); $repo->removePackage($initial); if (!$repo->hasPackage($target)) { $repo->addPackage(clone $target); } }