public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->initGingerBackend();
     $extra = $package->getExtra();
     $uninstallPluginCommand = new Cqrs\UninstallPluginCommand(array('plugin_name' => $package->getName(), 'plugin_type' => $package->getType(), 'plugin_namespace' => $extra['plugin-namespace'], 'plugin_version' => $package->getVersion()));
     $this->getServiceManager()->get('malocher.cqrs.gate')->getBus()->invokeCommand($uninstallPluginCommand);
     parent::uninstall($repo, $package);
 }
Beispiel #2
0
 /**
  * @inheritdoc
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     // uninstall the package the normal composer way
     parent::uninstall($repo, $package);
     // remove the package from yiisoft/extensions.php
     $this->removePackage($package);
     // remove links for Yii.php
     if ($package->getName() == 'yiisoft/yii2-dev') {
         $this->removeBaseYiiFiles();
     }
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
     $coreInstallPath = $this->getCoreInstallPath($package);
     // make sure we have absolute paths
     $coreInstallPath = realpath('') . '/' . rtrim($coreInstallPath, '/');
     if (is_link($coreInstallPath)) {
         $this->io->write(sprintf('    Removing concrete5 symlink %s - %s', $coreInstallPath, $this->filesystem->unlink($coreInstallPath) ? '<comment>removed</comment>' : '<error>not removed</error>'));
         $this->io->write('');
     }
 }
 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  *
  * @throws FilesystemException
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($package->isDev()) {
         if (!$repo->hasPackage($package)) {
             throw new \InvalidArgumentException('Package is not installed : ' . $package->getPrettyName());
         }
         $this->symlinkInstaller->uninstall($repo, $package);
     } else {
         $this->defaultInstaller->uninstall($repo, $package);
     }
 }
Beispiel #5
0
 /**
  * {@inheritDoc}
  */
 public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $extra = $package->getExtra();
     if (empty($extra['class'])) {
         throw new \UnexpectedValueException('Error while installing ' . $package->getPrettyName() . ', composer-plugin packages should have a class defined in their extra key to be usable.');
     }
     parent::install($repo, $package);
     try {
         $this->composer->getPluginManager()->registerPackage($package, true);
     } catch (\Exception $e) {
         // Rollback installation
         $this->io->writeError('Plugin installation failed, rolling back');
         parent::uninstall($repo, $package);
         throw $e;
     }
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $installedModules = $this->getInstalledModules();
     $filePath = $this->getConfigFilePath();
     // Get package information
     $name = $package->getPrettyName();
     $autoload = $package->getAutoload();
     // Remove the module from the list
     $installedModules = $this->array_remove_object($installedModules, $name, 'name');
     // Remove duplicated entries
     $installedModules = array_unique($installedModules, SORT_REGULAR);
     // Write to file
     $prettyJson = json_encode($installedModules, JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK);
     file_put_contents($filePath, $prettyJson);
     parent::uninstall($repo, $package);
 }
Beispiel #7
0
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
     $downloadPath = $this->getInstallPath($package);
     while (true) {
         if (is_dir($downloadPath)) {
             if (!glob($downloadPath . '/*')) {
                 if (false === @rmdir($downloadPath)) {
                     break;
                 }
             } else {
                 break;
             }
         } else {
             $downloadPath = dirname($downloadPath);
         }
     }
 }
Beispiel #8
0
 /**
  * {@inheritdoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) {
         return;
     }
     parent::uninstall($repo, $package);
 }
Beispiel #9
0
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->repository = $repo;
     $this->beforePatches($package, $package->getVersion(), '0');
     if ($repo->hasPackage($package)) {
         $modules = 0;
         foreach ($this->getModulesPaths($package) as $path) {
             $this->uninstallModule($path, $package);
             $modules++;
         }
         if ($modules) {
             $this->io->write('');
         }
     }
     $this->afterPatches($package, $package->getVersion(), '0');
     parent::uninstall($repo, $package);
 }
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
     $ns = $this->primaryNamespace($package);
     $this->updateConfig($ns, null);
 }
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->io->write("xpressengine-installer: uninstalling " . $package->getName());
     $extra = $this->composer->getPackage()->getExtra();
     $path = $extra['xpressengine-plugin']['path'];
     $data = json_decode(file_get_contents($path), true);
     if (in_array($package->getName(), $data['xpressengine-plugin']['uninstall'])) {
         parent::uninstall($repo, $package);
         static::$changed['uninstalled'][$package->getName()] = $package->getPrettyVersion();
     } else {
         $this->io->write("xpressengine-installer: skip to uninstall " . $package->getName());
         if ($this->checkDevPlugin($package)) {
             $repo->removePackage($package);
         }
     }
 }
Beispiel #13
0
 /**
  * Uninstalls a plugin if requested.
  *
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface $package
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $strPackageName = $package->getName();
     if (self::startsWith($strPackageName, 'qcubed/plugin')) {
         $this->composerPluginUninstall($package);
     }
     parent::uninstall($repo, $package);
 }
Beispiel #14
0
 /**
  * Uninstalls a package
  *
  * @access public
  * @param InstalledRepositoryInterface $repo The repository for installed packages
  * @param PackageInterface $package The package to uninstall
  * @return void
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (getenv('OPUS_DISABLED')) {
         parent::uninstall($repo, $package);
         return;
     }
     //
     // Return immediately if we have no information relevant to our installer
     //
     if (!$this->checkFrameworkSupport($package)) {
         return;
     }
     $this->loadInstallationMap();
     foreach ($this->installationMap as $path => $packages) {
         if (($key = array_search($package->getName(), $packages)) !== FALSE) {
             unset($this->installationMap[$path][$key]);
         }
     }
     $this->cleanup();
     $this->saveInstallationMap();
     parent::uninstall($repo, $package);
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
     $this->updatePortalAutoloadConfig();
 }
 /**
  * Uninstalls specific package.
  *
  * @param InstalledRepositoryInterface $repo repository in which to check
  * @param PackageInterface $package package instance
  *
  * @throws \InvalidArgumentException if $initial package is not installed
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $path = $this->getInstallPath($package);
     $this->removeExtension($path, $package);
     parent::uninstall($repo, $package);
 }
Beispiel #17
0
 /**
  * Uninstalls specific package.
  *
  * @param InstalledRepositoryInterface $repo    repository in which to check
  * @param PackageInterface             $package package instance
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     // skip marshal and apply default behavior if extra->map does not exist
     if (!$this->hasExtraMap($package)) {
         parent::uninstall($repo, $package);
         return;
     }
     $strategy = $this->getDeployStrategy($package);
     $strategy->setMappings($this->getParser($package)->getMappings());
     try {
         $strategy->clean();
     } catch (\ErrorException $e) {
         if ($this->io->isDebug()) {
             $this->io->write($e->getMessage());
         }
     }
     parent::uninstall($repo, $package);
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
     // post-uninstall: deactivate plugin
     $plugin_name = $this->getPluginName($package);
     $this->rcubeAlterConfig($plugin_name, false);
     // run post-uninstall script
     $extra = $package->getExtra();
     if (!empty($extra['roundcube']['post-uninstall-script'])) {
         $this->rcubeRunScript($extra['roundcube']['post-uninstall-script'], $package);
     }
 }
 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  *
  * @throws FilesystemException
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if ($this->isSourceDirUnused($package) && $this->io->askConfirmation("The package version <info>" . $package->getPrettyName() . "</info> " . "(<fg=yellow>" . $package->getPrettyVersion() . "</fg=yellow>) seems to be unused." . PHP_EOL . 'Do you want to <fg=red>delete the source folder</fg=red> ? [y/n] (default: no) : ', false)) {
         $this->packageDataManager->setPackageInstallationSource($package);
         parent::uninstall($repo, $package);
     } else {
         $this->binaryInstaller->removeBinaries($package);
         $repo->removePackage($package);
     }
     $this->packageDataManager->removePackageUsage($package);
     $this->removePackageVendorSymlink($package);
 }
 public function testUninstall()
 {
     $library = new LibraryInstaller($this->io, $this->composer);
     $package = $this->createPackageMock();
     $package->expects($this->any())->method('getPrettyName')->will($this->returnValue('pkg'));
     $this->repository->expects($this->exactly(2))->method('hasPackage')->with($package)->will($this->onConsecutiveCalls(true, false));
     $this->dm->expects($this->once())->method('remove')->with($package, $this->vendorDir . '/pkg');
     $this->repository->expects($this->once())->method('removePackage')->with($package);
     $library->uninstall($this->repository, $package);
     $this->setExpectedException('InvalidArgumentException');
     $library->uninstall($this->repository, $package);
 }
Beispiel #21
0
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
     $this->removeCommandsFromPackage($package);
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->cleanExtension($package);
     $unneeded = $this->extDirManager->removeExtension($package);
     $this->removeUnneeded($unneeded);
     parent::uninstall($repo, $package);
 }
 /**
  * Remove symlinks for Contao sources before uninstalling a package.
  *
  * {@inheritdoc}
  *
  * @throws \InvalidArgumentException When the requested package is not installed.
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (!$repo->hasPackage($package)) {
         throw new \InvalidArgumentException('Package is not installed: ' . $package);
     }
     $this->logVerbose(sprintf('Removing Contao sources for %s', $package->getName()));
     $this->removeSymlinks($package, $this->getContaoRoot(), $this->getSources($package));
     parent::uninstall($repo, $package);
     $this->logVerbose('');
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     if (is_null($this->package_installer)) {
         $this->io->write('<error>PackageInstaller not ready or missing configuration: package could not be installed.</error>');
     } else {
         $this->packageUninstall($package);
     }
     parent::uninstall($repo, $package);
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->removeAssets($package);
     parent::uninstall($repo, $package);
 }
 /**
  * {@inheritDoc}
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $this->uninstallEntryFiles($package);
     parent::uninstall($repo, $package);
 }
 /**
  * @param InstalledRepositoryInterface $repo
  * @param PackageInterface             $package
  *
  * @throws \Kisma\Core\Exceptions\FileSystemException
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     Log::info('Uninstall package "' . $package->getPrettyName() . ' ' . $package->getVersion());
     $this->_validatePackage($package);
     parent::uninstall($repo, $package);
     $this->_unlinkPlugIn();
 }
 /**
  * Uninstalls specific package.
  *
  * @param InstalledRepositoryInterface $repo    repository in which to check
  * @param PackageInterface             $package package instance
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     $strategy = $this->getDeployStrategy($package);
     $strategy->setMappings($this->getParser($package)->getMappings());
     $strategy->clean();
     parent::uninstall($repo, $package);
 }
 public function testUninstall()
 {
     $library = new LibraryInstaller($this->vendorDir, $this->binDir, $this->dm, $this->repository, $this->io);
     $package = $this->createPackageMock();
     $package->expects($this->once())->method('getPrettyName')->will($this->returnValue('pkg'));
     $this->repository->expects($this->exactly(2))->method('hasPackage')->with($package)->will($this->onConsecutiveCalls(true, false));
     $this->dm->expects($this->once())->method('remove')->with($package, $this->vendorDir . '/pkg');
     $this->repository->expects($this->once())->method('removePackage')->with($package);
     $library->uninstall($package);
     // TODO re-enable once #125 is fixed and we throw exceptions again
     //        $this->setExpectedException('InvalidArgumentException');
     $library->uninstall($package);
 }
 /**
  * { @inheritDoc }
  */
 public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
 {
     parent::uninstall($repo, $package);
     // TODO: remove files from opencart
 }