if ($composer->getRepositoryManager()->getLocalRepository()->findPackages($package)) {
$io->writeError('<error>Removal failed, '.$package.' is still present, it may be required by another package. See `composer why '.$package.'`.</error>');
$providersStr .= ' ... and '.(count($providers)-$maxProviders).' more.'."\n";
}
return array("- Root composer.json requires $packageName".self::constraintToText($constraint).", it ", "could not be found in any version, but the following packages provide it:\n".$providersStr." Consider requiring one of these to satisfy the $packageName requirement.");
}
@ -347,7 +349,7 @@ class Problem
}
/**
* @param string[] $versions an array of pretty versions, with normalized versions as keys
* @param string[] $versions an array of pretty versions, with normalized versions as keys
* @return list<string> a list of pretty versions and '...' where versions were removed
*/
private static function condenseVersionList(array $versions, $max)
@ -403,7 +405,6 @@ class Problem
}
return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', it is ', 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose).' from '.$nextRepo->getRepoName().' but '.self::getPackageList($higherRepoPackages, $isVerbose).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' has higher repository priority. The packages with higher priority do not match your '.$reason.' and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.');
return 'You can only install one version of a package, so only one of these can be installed: ' . $this->formatPackagesUnique($pool, $literals, $isVerbose) . '.';
case self::RULE_LEARNED:
/** @TODO currently still generates way too much output to be helpful, and in some cases can even lead to endless recursion
* @param string $eventName The constant in InstallerEvents
* @param bool $devMode Whether or not we are in dev mode
* @param bool $executeOperations True if operations will be executed, false in --dry-run
* @param Transaction $transaction The transaction contains the list of operations
* @param string $eventName The constant in InstallerEvents
* @param bool $devMode Whether or not we are in dev mode
* @param bool $executeOperations True if operations will be executed, false in --dry-run
* @param Transaction $transaction The transaction contains the list of operations
*
* @return int return code of the executed script if any, for php scripts a false return
* value is changed to 1, anything else to 0
@ -158,7 +158,6 @@ class EventDispatcher
$return = 0;
foreach ($listeners as $callable) {
$this->ensureBinDirIsInPath();
if (!is_string($callable)) {
@ -168,7 +167,7 @@ class EventDispatcher
throw new \RuntimeException('Subscriber '.$className.'::'.$callable[1].' for event '.$event->getName().' is not callable, make sure the function is defined and public');
}
if (is_array($callable) && (is_string($callable[0]) || is_object($callable[0])) && is_string($callable[1])) {
@ -20,19 +20,14 @@ use Composer\DependencyResolver\LockTransaction;
use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\DependencyResolver\Operation\UninstallOperation;
use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation;
use Composer\DependencyResolver\Operation\OperationInterface;
use Composer\DependencyResolver\PolicyInterface;
use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\Request;
use Composer\DependencyResolver\Rule;
use Composer\DependencyResolver\Solver;
use Composer\DependencyResolver\SolverProblemsException;
use Composer\Downloader\DownloadManager;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Installer\InstallationManager;
use Composer\Installer\InstallerEvents;
use Composer\Installer\NoopInstaller;
use Composer\Installer\SuggestedPackagesReporter;
use Composer\IO\IOInterface;
use Composer\Package\AliasPackage;
@ -41,7 +36,6 @@ use Composer\Package\BasePackage;
use Composer\Package\CompletePackage;
use Composer\Package\CompletePackageInterface;
use Composer\Package\Link;
use Composer\Package\LinkConstraint\VersionConstraint;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Dumper\ArrayDumper;
use Composer\Package\Version\VersionParser;
@ -50,9 +44,7 @@ use Composer\Repository\ArrayRepository;
use Composer\Repository\RepositorySet;
use Composer\Semver\Constraint\Constraint;
use Composer\Package\Locker;
use Composer\Package\PackageInterface;
use Composer\Package\RootPackageInterface;
use Composer\Repository\CompositeRepository;
use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Repository\InstalledRepository;
@ -376,6 +368,7 @@ class Installer
if ($this->updateAllowList) {
if (!$lockedRepository) {
$this->io->writeError('<error>Cannot update only a partial set of packages without a lock file present.</error>', true, IOInterface::QUIET);
return 1;
}
}
@ -612,9 +605,9 @@ class Installer
}
/**
* @param InstalledRepositoryInterface $localRepo
* @param bool $alreadySolved Whether the function is called as part of an update command or independently
* @return int exit code
* @param InstalledRepositoryInterface $localRepo
* @param bool $alreadySolved Whether the function is called as part of an update command or independently
* @return int exit code
*/
protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySolved = false)
{
@ -660,6 +653,7 @@ class Installer
// installing the locked packages on this platform resulted in lock modifying operations, there wasn't a conflict, but the lock file as-is seems to not work on this system
if (0 !== count($lockTransaction->getOperations())) {
$this->io->writeError('<error>Your lock file cannot be installed on this system without changes. Please run composer update.</error>', true, IOInterface::QUIET);
@ -182,8 +182,8 @@ class SuggestedPackagesReporter
}
/**
* @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped
* @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown
* @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped
* @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown
* @return array[]
*/
private function getFilteredSuggestions(InstalledRepository $installedRepo = null, PackageInterface $onlyDependentsOf = null)
* - The packages returned are the packages found which match the constraints, acceptable stability and stability flags provided
* - The namesFound returned are names which should be considered as canonically found in this repository, that should not be looked up in any further lower priority repositories
*
* @param ConstraintInterface[] $packageNameMap package names pointing to constraints
* @param int[] $acceptableStabilities array of stability => BasePackage::STABILITY_* value
* @param ConstraintInterface[] $packageNameMap package names pointing to constraints
* @param int[] $acceptableStabilities array of stability => BasePackage::STABILITY_* value