本文整理汇总了PHP中Composer\Installer\LibraryInstaller::uninstall方法的典型用法代码示例。如果您正苦于以下问题:PHP LibraryInstaller::uninstall方法的具体用法?PHP LibraryInstaller::uninstall怎么用?PHP LibraryInstaller::uninstall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Installer\LibraryInstaller
的用法示例。
在下文中一共展示了LibraryInstaller::uninstall方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
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);
}
示例2: uninstall
/**
* @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();
}
}
示例3: uninstall
/**
* {@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('');
}
}
示例4: uninstall
/**
* @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);
}
}
示例5: install
/**
* {@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;
}
}
示例6: uninstall
/**
* {@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);
}
示例7: uninstall
/**
* {@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);
}
}
}
示例8: uninstall
/**
* {@inheritdoc}
*/
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if ($this->isInstallFromSpressRoot() && self::TYPE_PLUGIN === $package->getType()) {
return;
}
parent::uninstall($repo, $package);
}
示例9: uninstall
/**
* {@inheritDoc}
*/
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
parent::uninstall($repo, $package);
}
示例10: uninstall
/**
* {@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);
}
示例11: uninstall
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
parent::uninstall($repo, $package);
$ns = $this->primaryNamespace($package);
$this->updateConfig($ns, null);
}
示例12: uninstall
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);
}
}
}
示例13: uninstall
/**
* 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);
}
示例14: uninstall
/**
* 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);
}
示例15: uninstall
/**
* {@inheritDoc}
*/
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
parent::uninstall($repo, $package);
$this->updatePortalAutoloadConfig();
}