本文整理汇总了PHP中Composer\Repository\InstalledRepositoryInterface::removePackage方法的典型用法代码示例。如果您正苦于以下问题:PHP InstalledRepositoryInterface::removePackage方法的具体用法?PHP InstalledRepositoryInterface::removePackage怎么用?PHP InstalledRepositoryInterface::removePackage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Repository\InstalledRepositoryInterface
的用法示例。
在下文中一共展示了InstalledRepositoryInterface::removePackage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
throw new \InvalidArgumentException('Package is not installed: ' . $package);
}
$repo->removePackage($package);
}
示例2: uninstall
/**
* {@inheritDoc}
*/
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
return;
}
$this->removeBinaries($package);
$repo->removePackage($package);
}
示例3: uninstall
/**
* {@inheritDoc}
*/
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
// TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
return;
throw new \InvalidArgumentException('Package is not installed: ' . $package);
}
$repo->removePackage($package);
}
示例4: uninstall
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
throw new \InvalidArgumentException('Package is not installed: ' . $package);
}
$repo->removePackage($package);
$installPath = $this->getInstallPath($package);
$this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
}
示例5: updateCode
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);
}
}
示例6: update
/**
* {@inheritDoc}
*/
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $package)
{
if (!$repo->hasPackage($initial)) {
throw new \InvalidArgumentException('Package is not installed: ' . $initial);
}
// Debug
$this->debug = $this->isDebug($package);
// Composer stuff
$this->initializeVendorDir();
$this->removeBinaries($initial);
$repo->removePackage($initial);
if (!$repo->hasPackage($package)) {
$repo->addPackage(clone $package);
}
$this->downloadAndExtractFile($package);
}
开发者ID:azt3k,项目名称:non-destructive-archive-installer,代码行数:19,代码来源:NonDestructiveArchiveInstallerInstaller.php
示例7: uninstall
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
throw new \InvalidArgumentException('Package is not installed: ' . $package);
}
$this->removeCode($package);
$this->removeBinaries($package);
$repo->removePackage($package);
$downloadPath = $this->getPackageBasePath($package);
if (strpos($package->getName(), '/')) {
$packageVendorDir = dirname($downloadPath);
if (is_dir($packageVendorDir) && $this->filesystem->isDirEmpty($packageVendorDir)) {
@rmdir($packageVendorDir);
}
}
}
示例8: uninstall
/**
* {@inheritDoc}
*/
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
// TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
return;
throw new \InvalidArgumentException('Package is not installed: ' . $package);
}
$downloadPath = $this->getInstallPath($package);
$this->removeCode($package);
$this->removeBinaries($package);
$repo->removePackage($package);
if (strpos($package->getName(), '/')) {
$packageVendorDir = dirname($downloadPath);
if (is_dir($packageVendorDir) && !glob($packageVendorDir . '/*')) {
@rmdir($packageVendorDir);
}
}
}
示例9: update
/**
* 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);
}
}
示例10: uninstall
/**
* Uninstalls specific package.
*
* @param \Composer\Repository\InstalledRepositoryInterface $repo repository in which to check
* @param \Composer\Package\PackageInterface $package package instance
*/
public function uninstall(\Composer\Repository\InstalledRepositoryInterface $repo, \Composer\Package\PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
throw new \InvalidArgumentException('Package is not installed: ' . $package);
}
if ($this->filesystem->someFilesExist($this->symlinks)) {
$this->filesystem->removeSymlinks($this->symlinks);
}
$this->removeCode($package);
$repo->removePackage($package);
}
示例11: uninstall
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
if (!$repo->hasPackage($package)) {
throw new \InvalidArgumentException('Package is not installed: ' . $package);
}
if ($package->getType() === MagentoInstaller::MAGENTO_SOURCE) {
$repo->removePackage($package);
$this->_makeBackup($repo, $package);
} else {
$repo->removePackage($package);
$installPath = $this->getInstallPath($package);
$this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
}
}
示例12: uninstall
function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$repo->removePackage($package);
$installPath = $this->getInstallPath($package);
$this->io->write(sprintf('Deleting %s - %s', $installPath, $this->filesystem->removeDirectory($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
}