1
0
Fork 0

Merge branch '1.10'

pull/8995/head
Jordi Boggiano 2020-06-16 17:16:42 +02:00
commit c8731598cc
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
22 changed files with 151 additions and 145 deletions

View File

@ -257,16 +257,16 @@ EOF;
EOF; EOF;
} }
$blacklist = null; $excluded = null;
if (!empty($autoloads['exclude-from-classmap'])) { if (!empty($autoloads['exclude-from-classmap'])) {
$blacklist = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}'; $excluded = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}';
} }
$classMap = array(); $classMap = array();
$ambiguousClasses = array(); $ambiguousClasses = array();
$scannedFiles = array(); $scannedFiles = array();
foreach ($autoloads['classmap'] as $dir) { foreach ($autoloads['classmap'] as $dir) {
$classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, null, $classMap, $ambiguousClasses, $scannedFiles); $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, null, null, $classMap, $ambiguousClasses, $scannedFiles);
} }
if ($scanPsrPackages) { if ($scanPsrPackages) {
@ -289,7 +289,7 @@ EOF;
continue; continue;
} }
$classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespace, $group['type'], $classMap, $ambiguousClasses, $scannedFiles); $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, $namespace, $group['type'], $classMap, $ambiguousClasses, $scannedFiles);
} }
} }
} }
@ -368,9 +368,9 @@ EOF;
return count($classMap); return count($classMap);
} }
private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespaceFilter, $autoloadType, array $classMap, array &$ambiguousClasses, array &$scannedFiles) private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $excluded, $namespaceFilter, $autoloadType, array $classMap, array &$ambiguousClasses, array &$scannedFiles)
{ {
foreach ($this->generateClassMap($dir, $blacklist, $namespaceFilter, $autoloadType, true, $scannedFiles) as $class => $path) { foreach ($this->generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, true, $scannedFiles) as $class => $path) {
$pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n"; $pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n";
if (!isset($classMap[$class])) { if (!isset($classMap[$class])) {
$classMap[$class] = $pathCode; $classMap[$class] = $pathCode;
@ -382,9 +382,9 @@ EOF;
return $classMap; return $classMap;
} }
private function generateClassMap($dir, $blacklist, $namespaceFilter, $autoloadType, $showAmbiguousWarning, array &$scannedFiles) private function generateClassMap($dir, $excluded, $namespaceFilter, $autoloadType, $showAmbiguousWarning, array &$scannedFiles)
{ {
return ClassMapGenerator::createMap($dir, $blacklist, $showAmbiguousWarning ? $this->io : null, $namespaceFilter, $autoloadType, $scannedFiles); return ClassMapGenerator::createMap($dir, $excluded, $showAmbiguousWarning ? $this->io : null, $namespaceFilter, $autoloadType, $scannedFiles);
} }
public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages) public function buildPackageMap(InstallationManager $installationManager, PackageInterface $mainPackage, array $packages)
@ -488,15 +488,15 @@ EOF;
} }
if (isset($autoloads['classmap'])) { if (isset($autoloads['classmap'])) {
$blacklist = null; $excluded = null;
if (!empty($autoloads['exclude-from-classmap'])) { if (!empty($autoloads['exclude-from-classmap'])) {
$blacklist = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}'; $excluded = '{(' . implode('|', $autoloads['exclude-from-classmap']) . ')}';
} }
$scannedFiles = array(); $scannedFiles = array();
foreach ($autoloads['classmap'] as $dir) { foreach ($autoloads['classmap'] as $dir) {
try { try {
$loader->addClassMap($this->generateClassMap($dir, $blacklist, null, null, false, $scannedFiles)); $loader->addClassMap($this->generateClassMap($dir, $excluded, null, null, false, $scannedFiles));
} catch (\RuntimeException $e) { } catch (\RuntimeException $e) {
$this->io->writeError('<warning>'.$e->getMessage().'</warning>'); $this->io->writeError('<warning>'.$e->getMessage().'</warning>');
} }

View File

@ -51,7 +51,7 @@ class ClassMapGenerator
* Iterate over all files in the given directory searching for classes * Iterate over all files in the given directory searching for classes
* *
* @param \Iterator|string $path The path to search in or an iterator * @param \Iterator|string $path The path to search in or an iterator
* @param string $blacklist Regex that matches against the file path that exclude from the classmap. * @param string $excluded Regex that matches against the file path that exclude from the classmap.
* @param IOInterface $io IO object * @param IOInterface $io IO object
* @param string $namespace Optional namespace prefix to filter by * @param string $namespace Optional namespace prefix to filter by
* @param string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules * @param string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules
@ -59,7 +59,7 @@ class ClassMapGenerator
* @throws \RuntimeException When the path is neither an existing file nor directory * @throws \RuntimeException When the path is neither an existing file nor directory
* @return array A class map array * @return array A class map array
*/ */
public static function createMap($path, $blacklist = null, IOInterface $io = null, $namespace = null, $autoloadType = null, &$scannedFiles = array()) public static function createMap($path, $excluded = null, IOInterface $io = null, $namespace = null, $autoloadType = null, &$scannedFiles = array())
{ {
$basePath = $path; $basePath = $path;
if (is_string($path)) { if (is_string($path)) {
@ -102,12 +102,12 @@ class ClassMapGenerator
continue; continue;
} }
// check the realpath of the file against the blacklist as the path might be a symlink and the blacklist is realpath'd so symlink are resolved // check the realpath of the file against the excluded paths as the path might be a symlink and the excluded path is realpath'd so symlink are resolved
if ($blacklist && preg_match($blacklist, strtr($realPath, '\\', '/'))) { if ($excluded && preg_match($excluded, strtr($realPath, '\\', '/'))) {
continue; continue;
} }
// check non-realpath of file for directories symlink in project dir // check non-realpath of file for directories symlink in project dir
if ($blacklist && preg_match($blacklist, strtr($filePath, '\\', '/'))) { if ($excluded && preg_match($excluded, strtr($filePath, '\\', '/'))) {
continue; continue;
} }

View File

@ -431,7 +431,11 @@ EOT
} }
$versionsUtil = new Versions($config, $this->httpDownloader); $versionsUtil = new Versions($config, $this->httpDownloader);
try {
$latest = $versionsUtil->getLatest(); $latest = $versionsUtil->getLatest();
} catch (\Exception $e) {
return $e;
}
if (Composer::VERSION !== $latest['version'] && Composer::VERSION !== '@package_version@') { if (Composer::VERSION !== $latest['version'] && Composer::VERSION !== '@package_version@') {
return '<comment>You are not running the latest '.$versionsUtil->getChannel().' version, run `composer self-update` to update ('.Composer::VERSION.' => '.$latest['version'].')</comment>'; return '<comment>You are not running the latest '.$versionsUtil->getChannel().' version, run `composer self-update` to update ('.Composer::VERSION.' => '.$latest['version'].')</comment>';

View File

@ -156,7 +156,7 @@ class Application extends BaseApplication
} }
// prompt user for dir change if no composer.json is present in current dir // prompt user for dir change if no composer.json is present in current dir
if ($io->isInteractive() && !$newWorkDir && !in_array($commandName, array('', 'list', 'init', 'about', 'help', 'diagnose', 'self-update', 'global', 'create-project'), true) && !file_exists(Factory::getComposerFile())) { if ($io->isInteractive() && !$newWorkDir && !in_array($commandName, array('', 'list', 'init', 'about', 'help', 'diagnose', 'self-update', 'global', 'create-project', 'outdated'), true) && !file_exists(Factory::getComposerFile())) {
$dir = dirname(getcwd()); $dir = dirname(getcwd());
$home = realpath(getenv('HOME') ?: getenv('USERPROFILE') ?: '/'); $home = realpath(getenv('HOME') ?: getenv('USERPROFILE') ?: '/');

View File

@ -338,14 +338,12 @@ class GitHubDriver extends VcsDriver
$this->branches = array(); $this->branches = array();
$resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_page=100'; $resource = $this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/git/refs/heads?per_page=100';
$branchBlacklist = array('gh-pages');
do { do {
$response = $this->getContents($resource); $response = $this->getContents($resource);
$branchData = $response->decodeJson(); $branchData = $response->decodeJson();
foreach ($branchData as $branch) { foreach ($branchData as $branch) {
$name = substr($branch['ref'], 11); $name = substr($branch['ref'], 11);
if (!in_array($name, $branchBlacklist)) { if ($name !== 'gh-pages') {
$this->branches[$name] = $branch['object']['sha']; $this->branches[$name] = $branch['object']['sha'];
} }
} }

View File

@ -63,7 +63,11 @@ class Versions
public function getLatest($channel = null) public function getLatest($channel = null)
{ {
$protocol = extension_loaded('openssl') ? 'https' : 'http'; if ($this->config->get('disable-tls') === true) {
$protocol = 'http';
} else {
$protocol = 'https';
}
$versions = $this->httpDownloader->get($protocol . '://getcomposer.org/versions')->decodeJson(); $versions = $this->httpDownloader->get($protocol . '://getcomposer.org/versions')->decodeJson();
foreach ($versions[$channel ?: $this->getChannel()] as $version) { foreach ($versions[$channel ?: $this->getChannel()] as $version) {

View File

@ -2,8 +2,8 @@
See Github issue #4795 ( github.com/composer/composer/issues/4795 ). See Github issue #4795 ( github.com/composer/composer/issues/4795 ).
Composer\Installer::whitelistUpdateDependencies should not output a warning for dependencies that need to be updated Composer\Installer::allowListUpdateDependencies should not output a warning for dependencies that need to be updated
that are also a root package, when that root package is also explicitly whitelisted. that are also a root package, when that root package is also explicitly allowed.
--COMPOSER-- --COMPOSER--
{ {

View File

@ -2,8 +2,8 @@
See Github issue #4795 ( github.com/composer/composer/issues/4795 ). See Github issue #4795 ( github.com/composer/composer/issues/4795 ).
Composer\Installer::whitelistUpdateDependencies intentionally ignores root requirements even if said package is also a Composer\Installer::allowListUpdateDependencies intentionally ignores root requirements even if said package is also a
dependency of one the requirements that is whitelisted for update. dependency of one the requirements that is allowed for update.
--COMPOSER-- --COMPOSER--
{ {

View File

@ -6,8 +6,8 @@ Install from a lock file that deleted a package
{ {
"type": "package", "type": "package",
"package": [ "package": [
{ "name": "whitelisted/pkg", "version": "1.1.0" }, { "name": "allowed/pkg", "version": "1.1.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "fixed/dependency": "1.0.0", "old/dependency": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "fixed/dependency": "1.0.0", "old/dependency": "1.0.0" } },
{ "name": "fixed/dependency", "version": "1.1.0" }, { "name": "fixed/dependency", "version": "1.1.0" },
{ "name": "fixed/dependency", "version": "1.0.0" }, { "name": "fixed/dependency", "version": "1.0.0" },
{ "name": "old/dependency", "version": "1.0.0" } { "name": "old/dependency", "version": "1.0.0" }
@ -15,14 +15,14 @@ Install from a lock file that deleted a package
} }
], ],
"require": { "require": {
"whitelisted/pkg": "1.*", "allowed/pkg": "1.*",
"fixed/dependency": "1.*" "fixed/dependency": "1.*"
} }
} }
--LOCK-- --LOCK--
{ {
"packages": [ "packages": [
{ "name": "whitelisted/pkg", "version": "1.1.0" }, { "name": "allowed/pkg", "version": "1.1.0" },
{ "name": "fixed/dependency", "version": "1.0.0" } { "name": "fixed/dependency", "version": "1.0.0" }
], ],
"packages-dev": [], "packages-dev": [],
@ -33,7 +33,7 @@ Install from a lock file that deleted a package
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } },
{ "name": "fixed/dependency", "version": "1.0.0" }, { "name": "fixed/dependency", "version": "1.0.0" },
{ "name": "old/dependency", "version": "1.0.0" } { "name": "old/dependency", "version": "1.0.0" }
] ]
@ -41,4 +41,4 @@ Install from a lock file that deleted a package
install install
--EXPECT-- --EXPECT--
Removing old/dependency (1.0.0) Removing old/dependency (1.0.0)
Upgrading whitelisted/pkg (1.0.0 => 1.1.0) Upgrading allowed/pkg (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Partial update forces updates dev reference from lock file for non whitelisted packages Partial update forces updates dev reference from lock file for non allowed packages
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [

View File

@ -1,13 +1,13 @@
--TEST-- --TEST--
Update with a package whitelist only updates those packages if they are not present in composer.json Update with a package allow list only updates those packages if they are not present in composer.json
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
{ {
"type": "package", "type": "package",
"package": [ "package": [
{ "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0", "fixed/dependency": "1.*" } }, { "name": "allowed/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0", "fixed/dependency": "1.*" } },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "fixed/dependency", "version": "1.1.0", "require": { "fixed/sub-dependency": "1.*" } }, { "name": "fixed/dependency", "version": "1.1.0", "require": { "fixed/sub-dependency": "1.*" } },
@ -18,13 +18,13 @@ Update with a package whitelist only updates those packages if they are not pres
} }
], ],
"require": { "require": {
"whitelisted/pkg": "1.*", "allowed/pkg": "1.*",
"fixed/dependency": "1.*" "fixed/dependency": "1.*"
} }
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "fixed/dependency", "version": "1.0.0", "require": { "fixed/sub-dependency": "1.*" } }, { "name": "fixed/dependency", "version": "1.0.0", "require": { "fixed/sub-dependency": "1.*" } },
{ "name": "fixed/sub-dependency", "version": "1.0.0" } { "name": "fixed/sub-dependency", "version": "1.0.0" }
@ -32,7 +32,7 @@ Update with a package whitelist only updates those packages if they are not pres
--LOCK-- --LOCK--
{ {
"packages": [ "packages": [
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "fixed/dependency", "version": "1.0.0", "require": { "fixed/sub-dependency": "1.*" } }, { "name": "fixed/dependency", "version": "1.0.0", "require": { "fixed/sub-dependency": "1.*" } },
{ "name": "fixed/sub-dependency", "version": "1.0.0" } { "name": "fixed/sub-dependency", "version": "1.0.0" }
@ -47,7 +47,7 @@ Update with a package whitelist only updates those packages if they are not pres
"platform-dev": [] "platform-dev": []
} }
--RUN-- --RUN--
update whitelisted/pkg dependency/pkg update allowed/pkg dependency/pkg
--EXPECT-- --EXPECT--
Upgrading dependency/pkg (1.0.0 => 1.1.0) Upgrading dependency/pkg (1.0.0 => 1.1.0)
Upgrading whitelisted/pkg (1.0.0 => 1.1.0) Upgrading allowed/pkg (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist pattern and all-dependencies flag updates packages and their dependencies, even if defined as root dependency, matching the pattern Update with a package allow list pattern and all-dependencies flag updates packages and their dependencies, even if defined as root dependency, matching the pattern
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
@ -8,10 +8,10 @@ Update with a package whitelist pattern and all-dependencies flag updates packag
"package": [ "package": [
{ "name": "fixed/pkg", "version": "1.1.0" }, { "name": "fixed/pkg", "version": "1.1.0" },
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.1.0" }, { "name": "allowed/pkg-component1", "version": "1.1.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } }, { "name": "allowed/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -23,8 +23,8 @@ Update with a package whitelist pattern and all-dependencies flag updates packag
], ],
"require": { "require": {
"fixed/pkg": "1.*", "fixed/pkg": "1.*",
"whitelisted/pkg-component1": "1.*", "allowed/pkg-component1": "1.*",
"whitelisted/pkg-component2": "1.*", "allowed/pkg-component2": "1.*",
"dependency/pkg": "1.*", "dependency/pkg": "1.*",
"unrelated/pkg": "1.*" "unrelated/pkg": "1.*"
} }
@ -32,8 +32,8 @@ Update with a package whitelist pattern and all-dependencies flag updates packag
--INSTALLED-- --INSTALLED--
[ [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -42,8 +42,8 @@ Update with a package whitelist pattern and all-dependencies flag updates packag
{ {
"packages": [ "packages": [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -58,8 +58,8 @@ Update with a package whitelist pattern and all-dependencies flag updates packag
"platform-dev": [] "platform-dev": []
} }
--RUN-- --RUN--
update whitelisted/pkg-* --with-all-dependencies update allowed/pkg-* --with-all-dependencies
--EXPECT-- --EXPECT--
Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component1 (1.0.0 => 1.1.0)
Upgrading dependency/pkg (1.0.0 => 1.1.0) Upgrading dependency/pkg (1.0.0 => 1.1.0)
Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component2 (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist only updates those packages and their dependencies matching the pattern but no dependencies defined as roo package Update with a package allow list only updates those packages and their dependencies matching the pattern but no dependencies defined as roo package
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
@ -8,10 +8,10 @@ Update with a package whitelist only updates those packages and their dependenci
"package": [ "package": [
{ "name": "fixed/pkg", "version": "1.1.0" }, { "name": "fixed/pkg", "version": "1.1.0" },
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.1.0" }, { "name": "allowed/pkg-component1", "version": "1.1.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*", "root/pkg-dependency": "1.*" } }, { "name": "allowed/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*", "root/pkg-dependency": "1.*" } },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*", "root/pkg-dependency": "1.*" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*", "root/pkg-dependency": "1.*" } },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "root/pkg-dependency", "version": "1.1.0" }, { "name": "root/pkg-dependency", "version": "1.1.0" },
@ -25,8 +25,8 @@ Update with a package whitelist only updates those packages and their dependenci
], ],
"require": { "require": {
"fixed/pkg": "1.*", "fixed/pkg": "1.*",
"whitelisted/pkg-component1": "1.*", "allowed/pkg-component1": "1.*",
"whitelisted/pkg-component2": "1.*", "allowed/pkg-component2": "1.*",
"root/pkg-dependency": "1.*", "root/pkg-dependency": "1.*",
"unrelated/pkg": "1.*" "unrelated/pkg": "1.*"
} }
@ -34,8 +34,8 @@ Update with a package whitelist only updates those packages and their dependenci
--INSTALLED-- --INSTALLED--
[ [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "root/pkg-dependency", "version": "1.0.0" }, { "name": "root/pkg-dependency", "version": "1.0.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -45,8 +45,8 @@ Update with a package whitelist only updates those packages and their dependenci
{ {
"packages": [ "packages": [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "root/pkg-dependency", "version": "1.0.0" }, { "name": "root/pkg-dependency", "version": "1.0.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -60,8 +60,8 @@ Update with a package whitelist only updates those packages and their dependenci
"prefer-lowest": false "prefer-lowest": false
} }
--RUN-- --RUN--
update whitelisted/pkg-* --with-dependencies update allowed/pkg-* --with-dependencies
--EXPECT-- --EXPECT--
Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component1 (1.0.0 => 1.1.0)
Upgrading dependency/pkg (1.0.0 => 1.1.0) Upgrading dependency/pkg (1.0.0 => 1.1.0)
Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component2 (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist only updates those packages and their dependencies matching the pattern Update with a package allow list only updates those packages and their dependencies matching the pattern
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
@ -8,16 +8,16 @@ Update with a package whitelist only updates those packages and their dependenci
"package": [ "package": [
{ "name": "fixed/pkg", "version": "1.1.0" }, { "name": "fixed/pkg", "version": "1.1.0" },
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.1.0", "require": { "whitelisted/pkg-component2": "1.1.0" } }, { "name": "allowed/pkg-component1", "version": "1.1.0", "require": { "allowed/pkg-component2": "1.1.0" } },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } }, { "name": "allowed/pkg-component1", "version": "1.0.0", "require": { "allowed/pkg-component2": "1.0.0" } },
{ "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0", "whitelisted/pkg-component5": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0", "allowed/pkg-component5": "1.0.0" } },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "whitelisted/pkg-component3", "version": "1.1.0", "require": { "whitelisted/pkg-component4": "1.1.0" } }, { "name": "allowed/pkg-component3", "version": "1.1.0", "require": { "allowed/pkg-component4": "1.1.0" } },
{ "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } }, { "name": "allowed/pkg-component3", "version": "1.0.0", "require": { "allowed/pkg-component4": "1.0.0" } },
{ "name": "whitelisted/pkg-component4", "version": "1.1.0" }, { "name": "allowed/pkg-component4", "version": "1.1.0" },
{ "name": "whitelisted/pkg-component4", "version": "1.0.0" }, { "name": "allowed/pkg-component4", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component5", "version": "1.1.0" }, { "name": "allowed/pkg-component5", "version": "1.1.0" },
{ "name": "whitelisted/pkg-component5", "version": "1.0.0" }, { "name": "allowed/pkg-component5", "version": "1.0.0" },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -29,20 +29,20 @@ Update with a package whitelist only updates those packages and their dependenci
], ],
"require": { "require": {
"fixed/pkg": "1.*", "fixed/pkg": "1.*",
"whitelisted/pkg-component1": "1.*", "allowed/pkg-component1": "1.*",
"whitelisted/pkg-component2": "1.*", "allowed/pkg-component2": "1.*",
"whitelisted/pkg-component3": "1.0.0", "allowed/pkg-component3": "1.0.0",
"unrelated/pkg": "1.*" "unrelated/pkg": "1.*"
} }
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } }, { "name": "allowed/pkg-component1", "version": "1.0.0", "require": { "allowed/pkg-component2": "1.0.0" } },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } }, { "name": "allowed/pkg-component3", "version": "1.0.0", "require": { "allowed/pkg-component4": "1.0.0" } },
{ "name": "whitelisted/pkg-component4", "version": "1.0.0" }, { "name": "allowed/pkg-component4", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component5", "version": "1.0.0" }, { "name": "allowed/pkg-component5", "version": "1.0.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -51,11 +51,11 @@ Update with a package whitelist only updates those packages and their dependenci
{ {
"packages": [ "packages": [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } }, { "name": "allowed/pkg-component1", "version": "1.0.0", "require": { "allowed/pkg-component2": "1.0.0" } },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } }, { "name": "allowed/pkg-component3", "version": "1.0.0", "require": { "allowed/pkg-component4": "1.0.0" } },
{ "name": "whitelisted/pkg-component4", "version": "1.0.0" }, { "name": "allowed/pkg-component4", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component5", "version": "1.0.0" }, { "name": "allowed/pkg-component5", "version": "1.0.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -70,8 +70,8 @@ Update with a package whitelist only updates those packages and their dependenci
"platform-dev": [] "platform-dev": []
} }
--RUN-- --RUN--
update whitelisted/pkg-* foobar --with-dependencies update allowed/pkg-* foobar --with-dependencies
--EXPECT-- --EXPECT--
Upgrading dependency/pkg (1.0.0 => 1.1.0) Upgrading dependency/pkg (1.0.0 => 1.1.0)
Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component2 (1.0.0 => 1.1.0)
Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component1 (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist only updates those packages matching the pattern Update with a package allow list only updates those packages matching the pattern
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
@ -8,10 +8,10 @@ Update with a package whitelist only updates those packages matching the pattern
"package": [ "package": [
{ "name": "fixed/pkg", "version": "1.1.0" }, { "name": "fixed/pkg", "version": "1.1.0" },
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.1.0" }, { "name": "allowed/pkg-component1", "version": "1.1.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } }, { "name": "allowed/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -23,16 +23,16 @@ Update with a package whitelist only updates those packages matching the pattern
], ],
"require": { "require": {
"fixed/pkg": "1.*", "fixed/pkg": "1.*",
"whitelisted/pkg-component1": "1.*", "allowed/pkg-component1": "1.*",
"whitelisted/pkg-component2": "1.*", "allowed/pkg-component2": "1.*",
"unrelated/pkg": "1.*" "unrelated/pkg": "1.*"
} }
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -41,8 +41,8 @@ Update with a package whitelist only updates those packages matching the pattern
{ {
"packages": [ "packages": [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component1", "version": "1.0.0" }, { "name": "allowed/pkg-component1", "version": "1.0.0" },
{ "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -55,7 +55,7 @@ Update with a package whitelist only updates those packages matching the pattern
"prefer-lowest": false "prefer-lowest": false
} }
--RUN-- --RUN--
update whitelisted/pkg-* update allowed/pkg-*
--EXPECT-- --EXPECT--
Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component1 (1.0.0 => 1.1.0)
Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) Upgrading allowed/pkg-component2 (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist only updates those corresponding to the pattern Update with a package allow list only updates those corresponding to the pattern
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [

View File

@ -1,13 +1,13 @@
--TEST-- --TEST--
Update with a package whitelist removes unused packages Update with a package allow list removes unused packages
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
{ {
"type": "package", "type": "package",
"package": [ "package": [
{ "name": "whitelisted/pkg", "version": "1.1.0" }, { "name": "allowed/pkg", "version": "1.1.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "fixed/dependency": "1.0.0", "old/dependency": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "fixed/dependency": "1.0.0", "old/dependency": "1.0.0" } },
{ "name": "fixed/dependency", "version": "1.1.0" }, { "name": "fixed/dependency", "version": "1.1.0" },
{ "name": "fixed/dependency", "version": "1.0.0" }, { "name": "fixed/dependency", "version": "1.0.0" },
{ "name": "old/dependency", "version": "1.0.0" } { "name": "old/dependency", "version": "1.0.0" }
@ -15,20 +15,20 @@ Update with a package whitelist removes unused packages
} }
], ],
"require": { "require": {
"whitelisted/pkg": "1.*", "allowed/pkg": "1.*",
"fixed/dependency": "1.*" "fixed/dependency": "1.*"
} }
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } },
{ "name": "fixed/dependency", "version": "1.0.0" }, { "name": "fixed/dependency", "version": "1.0.0" },
{ "name": "old/dependency", "version": "1.0.0" } { "name": "old/dependency", "version": "1.0.0" }
] ]
--LOCK-- --LOCK--
{ {
"packages": [ "packages": [
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } },
{ "name": "fixed/dependency", "version": "1.0.0" }, { "name": "fixed/dependency", "version": "1.0.0" },
{ "name": "old/dependency", "version": "1.0.0" } { "name": "old/dependency", "version": "1.0.0" }
], ],
@ -42,7 +42,7 @@ Update with a package whitelist removes unused packages
"platform-dev": [] "platform-dev": []
} }
--RUN-- --RUN--
update --with-dependencies whitelisted/pkg update --with-dependencies allowed/pkg
--EXPECT-- --EXPECT--
Removing old/dependency (1.0.0) Removing old/dependency (1.0.0)
Upgrading whitelisted/pkg (1.0.0 => 1.1.0) Upgrading allowed/pkg (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist only updates those packages and their dependencies listed as command arguments Update with a package allow list only updates those packages and their dependencies listed as command arguments
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
@ -8,8 +8,8 @@ Update with a package whitelist only updates those packages and their dependenci
"package": [ "package": [
{ "name": "fixed/pkg", "version": "1.1.0" }, { "name": "fixed/pkg", "version": "1.1.0" },
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0" } }, { "name": "allowed/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0" } },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -21,14 +21,14 @@ Update with a package whitelist only updates those packages and their dependenci
], ],
"require": { "require": {
"fixed/pkg": "1.*", "fixed/pkg": "1.*",
"whitelisted/pkg": "1.*", "allowed/pkg": "1.*",
"unrelated/pkg": "1.*" "unrelated/pkg": "1.*"
} }
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -37,7 +37,7 @@ Update with a package whitelist only updates those packages and their dependenci
{ {
"packages": [ "packages": [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -50,7 +50,7 @@ Update with a package whitelist only updates those packages and their dependenci
"prefer-lowest": false "prefer-lowest": false
} }
--RUN-- --RUN--
update whitelisted/pkg --with-dependencies update allowed/pkg --with-dependencies
--EXPECT-- --EXPECT--
Upgrading dependency/pkg (1.0.0 => 1.1.0) Upgrading dependency/pkg (1.0.0 => 1.1.0)
Upgrading whitelisted/pkg (1.0.0 => 1.1.0) Upgrading allowed/pkg (1.0.0 => 1.1.0)

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist only updates whitelisted packages if no dependency conflicts Update with a package allow list only updates allowed packages if no dependency conflicts
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
@ -8,8 +8,8 @@ Update with a package whitelist only updates whitelisted packages if no dependen
"package": [ "package": [
{ "name": "fixed/pkg", "version": "1.1.0" }, { "name": "fixed/pkg", "version": "1.1.0" },
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0" } }, { "name": "allowed/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0" } },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -21,14 +21,14 @@ Update with a package whitelist only updates whitelisted packages if no dependen
], ],
"require": { "require": {
"fixed/pkg": "1.*", "fixed/pkg": "1.*",
"whitelisted/pkg": "1.*", "allowed/pkg": "1.*",
"unrelated/pkg": "1.*" "unrelated/pkg": "1.*"
} }
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -37,7 +37,7 @@ Update with a package whitelist only updates whitelisted packages if no dependen
{ {
"packages": [ "packages": [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -50,5 +50,5 @@ Update with a package whitelist only updates whitelisted packages if no dependen
"prefer-lowest": false "prefer-lowest": false
} }
--RUN-- --RUN--
update whitelisted/pkg update allowed/pkg
--EXPECT-- --EXPECT--

View File

@ -1,5 +1,5 @@
--TEST-- --TEST--
Update with a package whitelist only updates those packages listed as command arguments Update with a package allow list only updates those packages listed as command arguments
--COMPOSER-- --COMPOSER--
{ {
"repositories": [ "repositories": [
@ -8,8 +8,8 @@ Update with a package whitelist only updates those packages listed as command ar
"package": [ "package": [
{ "name": "fixed/pkg", "version": "1.1.0" }, { "name": "fixed/pkg", "version": "1.1.0" },
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } }, { "name": "allowed/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } },
{ "name": "dependency/pkg", "version": "1.1.0" }, { "name": "dependency/pkg", "version": "1.1.0" },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } },
@ -21,14 +21,14 @@ Update with a package whitelist only updates those packages listed as command ar
], ],
"require": { "require": {
"fixed/pkg": "1.*", "fixed/pkg": "1.*",
"whitelisted/pkg": "1.*", "allowed/pkg": "1.*",
"unrelated/pkg": "1.*" "unrelated/pkg": "1.*"
} }
} }
--INSTALLED-- --INSTALLED--
[ [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency": "1.*" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency": "1.*" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -37,7 +37,7 @@ Update with a package whitelist only updates those packages listed as command ar
{ {
"packages": [ "packages": [
{ "name": "fixed/pkg", "version": "1.0.0" }, { "name": "fixed/pkg", "version": "1.0.0" },
{ "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, { "name": "allowed/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } },
{ "name": "dependency/pkg", "version": "1.0.0" }, { "name": "dependency/pkg", "version": "1.0.0" },
{ "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } },
{ "name": "unrelated/pkg-dependency", "version": "1.0.0" } { "name": "unrelated/pkg-dependency", "version": "1.0.0" }
@ -52,6 +52,6 @@ Update with a package whitelist only updates those packages listed as command ar
"platform-dev": [] "platform-dev": []
} }
--RUN-- --RUN--
update whitelisted/pkg update allowed/pkg
--EXPECT-- --EXPECT--
Upgrading whitelisted/pkg (1.0.0 => 1.1.0) Upgrading allowed/pkg (1.0.0 => 1.1.0)

View File

@ -3,10 +3,10 @@ Update updates URLs for updated packages if they have changed
a/a is dev and gets everything updated as it updates to a new ref a/a is dev and gets everything updated as it updates to a new ref
b/b is a tag and gets everything updated by updating the package URL directly b/b is a tag and gets everything updated by updating the package URL directly
c/c is a tag and not whitelisted and remains unchanged c/c is a tag and not allowlisted and remains unchanged
d/d is dev but with a #ref so it should get URL updated but not the reference d/d is dev but with a #ref so it should get URL updated but not the reference
e/e is dev and newly installed with a #ref so it should get the correct URL but with the #111 ref e/e is dev and newly installed with a #ref so it should get the correct URL but with the #111 ref
f/f is dev but not whitelisted and remains unchanged f/f is dev but not allowlisted and remains unchanged
g/g is dev and installed in a different ref than the #ref, so it gets updated and gets the new URL but not the new ref g/g is dev and installed in a different ref than the #ref, so it gets updated and gets the new URL but not the new ref
--COMPOSER-- --COMPOSER--
{ {

View File

@ -2,7 +2,7 @@
See Github issue #6661 ( github.com/composer/composer/issues/6661 ). See Github issue #6661 ( github.com/composer/composer/issues/6661 ).
When `--with-all-dependencies` is used, Composer\Installer::whitelistUpdateDependencies should update the dependencies of all whitelisted packages, even if the dependency is a root requirement. When `--with-all-dependencies` is used, Composer\Installer::allowListUpdateDependencies should update the dependencies of all allowed packages, even if the dependency is a root requirement.
--COMPOSER-- --COMPOSER--
{ {