From 32a7ceac2f78359b3ce26ab7e734ab71ff41a4e4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 10:06:00 +0200 Subject: [PATCH 01/14] Improve exception message when a package cannot be added in another repo, refs #10940 --- src/Composer/Package/BasePackage.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Composer/Package/BasePackage.php b/src/Composer/Package/BasePackage.php index a3ec9c570..8f225cbd3 100644 --- a/src/Composer/Package/BasePackage.php +++ b/src/Composer/Package/BasePackage.php @@ -135,7 +135,12 @@ abstract class BasePackage implements PackageInterface public function setRepository(RepositoryInterface $repository) { if ($this->repository && $repository !== $this->repository) { - throw new \LogicException('A package can only be added to one repository'); + throw new \LogicException(sprintf( + 'Package "%s" cannot be added to repository "%s" as it is already in repository "%s".', + $this->getPrettyName(), + $repository->getRepoName(), + $this->repository->getRepoName(), + )); } $this->repository = $repository; } From f600ea46c76a7126eb1fac4c6c6013a965213e6c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 10:09:33 +0200 Subject: [PATCH 02/14] Fix syntax error --- src/Composer/Package/BasePackage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Package/BasePackage.php b/src/Composer/Package/BasePackage.php index 8f225cbd3..3bedbf596 100644 --- a/src/Composer/Package/BasePackage.php +++ b/src/Composer/Package/BasePackage.php @@ -139,7 +139,7 @@ abstract class BasePackage implements PackageInterface 'Package "%s" cannot be added to repository "%s" as it is already in repository "%s".', $this->getPrettyName(), $repository->getRepoName(), - $this->repository->getRepoName(), + $this->repository->getRepoName() )); } $this->repository = $repository; From a481dfce3fc5312a2bee581d4df7f72ced52e84b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 10:35:32 +0200 Subject: [PATCH 03/14] Fix disk_free_space being called even when not available, fixes #10936 --- src/Composer/Cache.php | 4 ++-- src/Composer/Command/DiagnoseCommand.php | 4 ++++ src/Composer/Console/Application.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Composer/Cache.php b/src/Composer/Cache.php index 61ae44f82..cafad5a28 100644 --- a/src/Composer/Cache.php +++ b/src/Composer/Cache.php @@ -162,11 +162,11 @@ class Cache unlink($tempFileName); $message = sprintf( - 'Writing %1$s into cache failed after %2$u of %3$u bytes written, only %4$u bytes of free space available', + 'Writing %1$s into cache failed after %2$u of %3$u bytes written, only %4$s bytes of free space available', $tempFileName, $m[1], $m[2], - @disk_free_space(dirname($tempFileName)) + function_exists('disk_free_space') ? @disk_free_space(dirname($tempFileName)) : 'unknown' ); $this->io->writeError($message); diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php index 242c58154..6e56f3a4f 100644 --- a/src/Composer/Command/DiagnoseCommand.php +++ b/src/Composer/Command/DiagnoseCommand.php @@ -370,6 +370,10 @@ EOT */ private function checkDiskSpace(Config $config) { + if (!function_exists('disk_free_space')) { + return true; + } + $minSpaceFree = 1024 * 1024; if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree) || (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index e7c3a32a5..86e89e88b 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -386,7 +386,7 @@ class Application extends BaseApplication Silencer::suppress(); try { $composer = $this->getComposer(false, true); - if ($composer) { + if (null !== $composer && function_exists('disk_free_space')) { $config = $composer->getConfig(); $minSpaceFree = 1024 * 1024; From 55fe12bd657dcb81ae20817a4095d7bc59742606 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 13:23:27 +0200 Subject: [PATCH 04/14] Allow disabling only local or global plugins internally to fix #10935 without side-effects --- src/Composer/Command/CreateProjectCommand.php | 10 +--- src/Composer/Factory.php | 9 ++-- src/Composer/Installer/PluginInstaller.php | 2 +- src/Composer/Plugin/PluginManager.php | 53 +++++++++---------- 4 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index 4bccc3dc4..7f7487dea 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -403,15 +403,7 @@ EOT throw new \InvalidArgumentException('Invalid stability provided ('.$stability.'), must be one of: '.implode(', ', array_keys(BasePackage::$stabilities))); } - $composerJson = array_merge( - // prevent version guessing from happening - array('version' => '1.0.0'), - $config->all(), - // ensure the vendor dir and its plugins does not get loaded if CWD/vendor has plugins in it - array('config' => array('vendor-dir' => Platform::getDevNull())) - ); - $factory = new Factory; - $composer = $factory->createComposer($io, $composerJson, $disablePlugins, Platform::getDevNull(), true, $disableScripts); + $composer = Factory::create($io, $config->all(), $disablePlugins === true ? true : 'local', $disableScripts); $config = $composer->getConfig(); $rm = $composer->getRepositoryManager(); diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 9248071ca..5cc3867df 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -293,7 +293,7 @@ class Factory * @param IOInterface $io IO instance * @param array|string|null $localConfig either a configuration array or a filename to read from, if null it will * read from the default filename - * @param bool $disablePlugins Whether plugins should not be loaded + * @param bool|'local'|'global' $disablePlugins Whether plugins should not be loaded, can be set to local or global to only disable local/global plugins * @param bool $disableScripts Whether scripts should not be run * @param string|null $cwd * @param bool $fullLoad Whether to initialize everything or only main project stuff (used when loading the global composer) @@ -500,6 +500,9 @@ class Factory */ protected function createGlobalComposer(IOInterface $io, Config $config, $disablePlugins, $disableScripts, $fullLoad = false) { + // make sure if disable plugins was 'local' it is now turned off + $disablePlugins = $disablePlugins === 'global' || $disablePlugins === true; + $composer = null; try { $composer = $this->createComposer($io, $config->get('home') . '/composer.json', $disablePlugins, $config->get('home'), $fullLoad, $disableScripts); @@ -579,7 +582,7 @@ class Factory * @param IOInterface $io * @param Composer $composer * @param Composer $globalComposer - * @param bool $disablePlugins + * @param bool|'local'|'global' $disablePlugins Whether plugins should not be loaded, can be set to local or global to only disable local/global plugins * @return Plugin\PluginManager */ protected function createPluginManager(IOInterface $io, Composer $composer, Composer $globalComposer = null, $disablePlugins = false) @@ -635,7 +638,7 @@ class Factory * @param IOInterface $io IO instance * @param mixed $config either a configuration array or a filename to read from, if null it will read from * the default filename - * @param bool $disablePlugins Whether plugins should not be loaded + * @param bool|'local'|'global' $disablePlugins Whether plugins should not be loaded, can be set to local or global to only disable local/global plugins * @param bool $disableScripts Whether scripts should not be run * @return Composer */ diff --git a/src/Composer/Installer/PluginInstaller.php b/src/Composer/Installer/PluginInstaller.php index 14d8caf9b..af9dd2d89 100644 --- a/src/Composer/Installer/PluginInstaller.php +++ b/src/Composer/Installer/PluginInstaller.php @@ -53,7 +53,7 @@ class PluginInstaller extends LibraryInstaller public function prepare($type, PackageInterface $package, PackageInterface $prevPackage = null) { // fail install process early if it is going to fail due to a plugin not being allowed - if (($type === 'install' || $type === 'update') && !$this->composer->getPluginManager()->arePluginsDisabled()) { + if (($type === 'install' || $type === 'update') && !$this->composer->getPluginManager()->arePluginsDisabled('local')) { $this->composer->getPluginManager()->isPluginAllowed($package->getName(), false); } diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index c3647438c..fdf50c4d4 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -47,7 +47,7 @@ class PluginManager protected $globalComposer; /** @var VersionParser */ protected $versionParser; - /** @var bool */ + /** @var bool|'local'|'global' */ protected $disablePlugins = false; /** @var array */ @@ -74,7 +74,7 @@ class PluginManager * @param IOInterface $io * @param Composer $composer * @param Composer $globalComposer - * @param bool $disablePlugins + * @param bool|'local'|'global' $disablePlugins Whether plugins should not be loaded, can be set to local or global to only disable local/global plugins */ public function __construct(IOInterface $io, Composer $composer, Composer $globalComposer = null, $disablePlugins = false) { @@ -94,15 +94,16 @@ class PluginManager */ public function loadInstalledPlugins() { - if ($this->disablePlugins) { - return; + if (!$this->arePluginsDisabled('local')) { + $repo = $this->composer->getRepositoryManager()->getLocalRepository(); + $this->loadRepository($repo, false); } - $repo = $this->composer->getRepositoryManager()->getLocalRepository(); - $globalRepo = $this->globalComposer !== null ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; - $this->loadRepository($repo, false); - if ($globalRepo) { - $this->loadRepository($globalRepo, true); + if (!$this->arePluginsDisabled('global')) { + $globalRepo = $this->globalComposer !== null ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; + if ($globalRepo !== null) { + $this->loadRepository($globalRepo, true); + } } } @@ -113,15 +114,16 @@ class PluginManager */ public function deactivateInstalledPlugins() { - if ($this->disablePlugins) { - return; + if (!$this->arePluginsDisabled('local')) { + $repo = $this->composer->getRepositoryManager()->getLocalRepository(); + $this->deactivateRepository($repo, false); } - $repo = $this->composer->getRepositoryManager()->getLocalRepository(); - $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; - $this->deactivateRepository($repo, false); - if ($globalRepo) { - $this->deactivateRepository($globalRepo, true); + if (!$this->arePluginsDisabled('global')) { + $globalRepo = $this->globalComposer ? $this->globalComposer->getRepositoryManager()->getLocalRepository() : null; + if ($globalRepo !== null) { + $this->deactivateRepository($globalRepo, true); + } } } @@ -161,7 +163,7 @@ class PluginManager */ public function registerPackage(PackageInterface $package, $failOnMissingClasses = false, $isGlobalPlugin = false) { - if ($this->disablePlugins) { + if ($this->arePluginsDisabled($isGlobalPlugin ? 'global' : 'local')) { return; } @@ -320,10 +322,6 @@ class PluginManager */ public function deactivatePackage(PackageInterface $package) { - if ($this->disablePlugins) { - return; - } - if (!isset($this->registeredPlugins[$package->getName()])) { return; } @@ -351,10 +349,6 @@ class PluginManager */ public function uninstallPackage(PackageInterface $package) { - if ($this->disablePlugins) { - return; - } - if (!isset($this->registeredPlugins[$package->getName()])) { return; } @@ -394,6 +388,10 @@ class PluginManager */ public function addPlugin(PluginInterface $plugin, $isGlobalPlugin = false, PackageInterface $sourcePackage = null) { + if ($this->arePluginsDisabled($isGlobalPlugin ? 'global' : 'local')) { + return; + } + if ($sourcePackage === null) { trigger_error('Calling PluginManager::addPlugin without $sourcePackage is deprecated, if you are using this please get in touch with us to explain the use case', E_USER_DEPRECATED); } elseif (!$this->isPluginAllowed($sourcePackage->getName(), $isGlobalPlugin)) { @@ -682,11 +680,12 @@ class PluginManager /** * @internal * + * @param 'local'|'global' $type * @return bool */ - public function arePluginsDisabled() + public function arePluginsDisabled($type) { - return $this->disablePlugins; + return $this->disablePlugins === true || $this->disablePlugins === $type; } /** From 37a788932d052bce9a0519bd124e05b3b61dba8f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 13:35:03 +0200 Subject: [PATCH 05/14] Fix phpdoc issue --- src/Composer/Factory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 5cc3867df..84c229603 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -492,7 +492,7 @@ class Factory } /** - * @param bool $disablePlugins + * @param bool|'local'|'global' $disablePlugins Whether plugins should not be loaded, can be set to local or global to only disable local/global plugins * @param bool $disableScripts * @param bool $fullLoad * From 0e59fbb46eee2b89245dc347bfb4d6efbc6f2591 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 14:13:02 +0200 Subject: [PATCH 06/14] Fix #10935 in a more generic way which fixes the issue for all Factory::create usages --- src/Composer/Command/CreateProjectCommand.php | 2 +- src/Composer/Factory.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index 7f7487dea..826f41c86 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -403,7 +403,7 @@ EOT throw new \InvalidArgumentException('Invalid stability provided ('.$stability.'), must be one of: '.implode(', ', array_keys(BasePackage::$stabilities))); } - $composer = Factory::create($io, $config->all(), $disablePlugins === true ? true : 'local', $disableScripts); + $composer = Factory::create($io, $config->all(), $disablePlugins, $disableScripts); $config = $composer->getConfig(); $rm = $composer->getRepositoryManager(); diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 84c229603..609c1cc24 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -646,6 +646,14 @@ class Factory { $factory = new static(); + // for BC reasons, if a config is passed in either as array or a path that is not the default composer.json path + // we disable local plugins as they really should not be loaded from CWD + // If you want to avoid this behavior, you should be calling createComposer directly with a $cwd arg set correctly + // to the path where the composer.json being loaded resides + if ($config !== null && $config !== self::getComposerFile() && $disablePlugins === false) { + $disablePlugins = 'local'; + } + return $factory->createComposer($io, $config, $disablePlugins, null, true, $disableScripts); } From 336a0d20c6cd2004b2374f88c30cd15bece7d0ba Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 14:38:54 +0200 Subject: [PATCH 07/14] Add hint in create-project when it fails due to a missing allow-plugins in project, refs #10928 --- src/Composer/Command/CreateProjectCommand.php | 13 ++++++++++--- .../Plugin/PluginBlockedException.php | 19 +++++++++++++++++++ src/Composer/Plugin/PluginManager.php | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 src/Composer/Plugin/PluginBlockedException.php diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index 826f41c86..466611402 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -26,6 +26,7 @@ use Composer\DependencyResolver\Operation\InstallOperation; use Composer\Package\Version\VersionSelector; use Composer\Package\AliasPackage; use Composer\Pcre\Preg; +use Composer\Plugin\PluginBlockedException; use Composer\Repository\RepositoryFactory; use Composer\Repository\CompositeRepository; use Composer\Repository\PlatformRepository; @@ -268,9 +269,15 @@ EOT $installer->disablePlugins(); } - $status = $installer->run(); - if (0 !== $status) { - return $status; + try { + $status = $installer->run(); + if (0 !== $status) { + return $status; + } + } catch (PluginBlockedException $e) { + $io->writeError('Hint: To allow running the config command recommended below before dependencies are installed, run create-project with --no-install.'); + $io->writeError('You can then cd into '.getcwd().', configure allow-plugins, and finally run a composer install to complete the process.'); + throw $e; } } diff --git a/src/Composer/Plugin/PluginBlockedException.php b/src/Composer/Plugin/PluginBlockedException.php new file mode 100644 index 000000000..04a8db005 --- /dev/null +++ b/src/Composer/Plugin/PluginBlockedException.php @@ -0,0 +1,19 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Plugin; + +use UnexpectedValueException; + +class PluginBlockedException extends UnexpectedValueException +{ +} diff --git a/src/Composer/Plugin/PluginManager.php b/src/Composer/Plugin/PluginManager.php index fdf50c4d4..dc6dc8d11 100644 --- a/src/Composer/Plugin/PluginManager.php +++ b/src/Composer/Plugin/PluginManager.php @@ -765,7 +765,7 @@ class PluginManager } } - throw new \UnexpectedValueException( + throw new PluginBlockedException( $package.($isGlobalPlugin ? ' (installed globally)' : '').' contains a Composer plugin which is blocked by your allow-plugins config. You may add it to the list if you consider it safe.'.PHP_EOL. 'You can run "composer '.($isGlobalPlugin ? 'global ' : '').'config --no-plugins allow-plugins.'.$package.' [true|false]" to enable it (true) or disable it explicitly and suppress this exception (false)'.PHP_EOL. 'See https://getcomposer.org/allow-plugins' From b195f383f2474cb0ec68bead4467079bfd136f60 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 15:10:15 +0200 Subject: [PATCH 08/14] Always clone root package before adding it to a RootPackageRepo to avoid issues with plugins, fixes #10940 --- src/Composer/Command/BaseDependencyCommand.php | 2 +- src/Composer/Command/CheckPlatformReqsCommand.php | 2 +- src/Composer/Command/HomeCommand.php | 2 +- src/Composer/Command/ShowCommand.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Command/BaseDependencyCommand.php b/src/Composer/Command/BaseDependencyCommand.php index ba48173da..78eeaea85 100644 --- a/src/Composer/Command/BaseDependencyCommand.php +++ b/src/Composer/Command/BaseDependencyCommand.php @@ -59,7 +59,7 @@ class BaseDependencyCommand extends BaseCommand $platformOverrides = $composer->getConfig()->get('platform') ?: array(); $installedRepo = new InstalledRepository(array( - new RootPackageRepository($composer->getPackage()), + new RootPackageRepository(clone $composer->getPackage()), $composer->getRepositoryManager()->getLocalRepository(), new PlatformRepository(array(), $platformOverrides), )); diff --git a/src/Composer/Command/CheckPlatformReqsCommand.php b/src/Composer/Command/CheckPlatformReqsCommand.php index 73aee9551..aa5b95e46 100644 --- a/src/Composer/Command/CheckPlatformReqsCommand.php +++ b/src/Composer/Command/CheckPlatformReqsCommand.php @@ -80,7 +80,7 @@ EOT $requires[$require] = array($link); } - $installedRepo = new InstalledRepository(array($installedRepo, new RootPackageRepository($composer->getPackage()))); + $installedRepo = new InstalledRepository(array($installedRepo, new RootPackageRepository(clone $composer->getPackage()))); foreach ($installedRepo->getPackages() as $package) { if (in_array($package->getName(), $removePackages, true)) { continue; diff --git a/src/Composer/Command/HomeCommand.php b/src/Composer/Command/HomeCommand.php index ad4a42713..775aa04b9 100644 --- a/src/Composer/Command/HomeCommand.php +++ b/src/Composer/Command/HomeCommand.php @@ -167,7 +167,7 @@ EOT if ($composer) { return array_merge( - array(new RootPackageRepository($composer->getPackage())), // root package + array(new RootPackageRepository(clone $composer->getPackage())), // root package array($composer->getRepositoryManager()->getLocalRepository()), // installed packages $composer->getRepositoryManager()->getRepositories() // remotes ); diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 6df57e08c..3e14bd834 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -167,7 +167,7 @@ EOT $lockedRepo = null; if ($input->getOption('self')) { - $package = $this->getComposer()->getPackage(); + $package = clone $this->getComposer()->getPackage(); if ($input->getOption('name-only')) { $io->write($package->getName()); From 5cb24aaa815288f7656b1db84a2cfcd4eefcd050 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 15:27:29 +0200 Subject: [PATCH 09/14] Update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75a4ffe0f..47b60b44e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +### [2.2.17] 2022-07-13 + + * Fixed plugins from CWD/vendor being loaded in some cases like create-project or validate even though the target directory is outside of CWD (#10935) + * Fixed support for legacy (Composer 1.x, e.g. hirak/prestissimo) plugins which will not warn/error anymore if not in allow-plugins, as they are anyway not loaded (#10928) + * Fixed pre-install check for allowed plugins not taking --no-plugins into account (#10925) + * Fixed support for disable_functions containing disk_free_space (#10936) + * Fixed RootPackageRepository usages to always clone the root package to avoid interoperability issues with plugins (#10940) + ### [2.2.16] 2022-07-05 * Fixed non-interactive behavior of allow-plugins to throw instead of continue with a warning to avoid broken installs (#10920) @@ -1461,6 +1469,7 @@ * Initial release +[2.2.17]: https://github.com/composer/composer/compare/2.2.16...2.2.17 [2.2.16]: https://github.com/composer/composer/compare/2.2.15...2.2.16 [2.2.15]: https://github.com/composer/composer/compare/2.2.14...2.2.15 [2.2.14]: https://github.com/composer/composer/compare/2.2.13...2.2.14 From a8ab5070fb99396e4710baee286478ad697724c2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 15:27:38 +0200 Subject: [PATCH 10/14] Release 2.2.17 --- src/Composer/Composer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 624e02507..06e8eb64d 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -52,10 +52,10 @@ class Composer * const RELEASE_DATE = '@release_date@'; * const SOURCE_VERSION = '1.8-dev+source'; */ - const VERSION = '@package_version@'; - const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@'; - const RELEASE_DATE = '@release_date@'; - const SOURCE_VERSION = '2.2.999-dev+source'; + const VERSION = '2.2.17'; + const BRANCH_ALIAS_VERSION = ''; + const RELEASE_DATE = '2022-07-13 15:27:38'; + const SOURCE_VERSION = ''; /** * Version number of the internal composer-runtime-api package From c5ff1e1fc67f0f6cf4edd03f78600de81f643923 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 15:27:38 +0200 Subject: [PATCH 11/14] Reverting release version changes --- src/Composer/Composer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 06e8eb64d..624e02507 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -52,10 +52,10 @@ class Composer * const RELEASE_DATE = '@release_date@'; * const SOURCE_VERSION = '1.8-dev+source'; */ - const VERSION = '2.2.17'; - const BRANCH_ALIAS_VERSION = ''; - const RELEASE_DATE = '2022-07-13 15:27:38'; - const SOURCE_VERSION = ''; + const VERSION = '@package_version@'; + const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@'; + const RELEASE_DATE = '@release_date@'; + const SOURCE_VERSION = '2.2.999-dev+source'; /** * Version number of the internal composer-runtime-api package From f54878d92e31ab5e5c90c16d3a2896fc827e7ef0 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 15:48:20 +0200 Subject: [PATCH 12/14] Update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1aea7dbe..43419d94a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +### [2.3.10] 2022-07-13 + + * Fixed plugins from CWD/vendor being loaded in some cases like create-project or validate even though the target directory is outside of CWD (#10935) + * Fixed support for legacy (Composer 1.x, e.g. hirak/prestissimo) plugins which will not warn/error anymore if not in allow-plugins, as they are anyway not loaded (#10928) + * Fixed pre-install check for allowed plugins not taking --no-plugins into account (#10925) + * Fixed support for disable_functions containing disk_free_space (#10936) + * Fixed RootPackageRepository usages to always clone the root package to avoid interoperability issues with plugins (#10940) + ### [2.3.9] 2022-07-05 * Fixed non-interactive behavior of allow-plugins to throw instead of continue with a warning to avoid broken installs (#10920) @@ -1582,6 +1590,7 @@ * Initial release +[2.3.10]: https://github.com/composer/composer/compare/2.3.9...2.3.10 [2.3.9]: https://github.com/composer/composer/compare/2.3.8...2.3.9 [2.3.8]: https://github.com/composer/composer/compare/2.3.7...2.3.8 [2.3.7]: https://github.com/composer/composer/compare/2.3.6...2.3.7 From ebac357c0a41359f3981098729042ed6dedc97ba Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 15:48:23 +0200 Subject: [PATCH 13/14] Release 2.3.10 --- src/Composer/Composer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 93e8c0a6f..87505f849 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -51,10 +51,10 @@ class Composer extends PartialComposer * * @see getVersion() */ - public const VERSION = '@package_version@'; - public const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@'; - public const RELEASE_DATE = '@release_date@'; - public const SOURCE_VERSION = '2.3.999-dev+source'; + public const VERSION = '2.3.10'; + public const BRANCH_ALIAS_VERSION = ''; + public const RELEASE_DATE = '2022-07-13 15:48:23'; + public const SOURCE_VERSION = ''; /** * Version number of the internal composer-runtime-api package From 80a0d3236dad7471e06bc92ddd178334fad78aa9 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 13 Jul 2022 15:48:23 +0200 Subject: [PATCH 14/14] Reverting release version changes --- src/Composer/Composer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 87505f849..93e8c0a6f 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -51,10 +51,10 @@ class Composer extends PartialComposer * * @see getVersion() */ - public const VERSION = '2.3.10'; - public const BRANCH_ALIAS_VERSION = ''; - public const RELEASE_DATE = '2022-07-13 15:48:23'; - public const SOURCE_VERSION = ''; + public const VERSION = '@package_version@'; + public const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@'; + public const RELEASE_DATE = '@release_date@'; + public const SOURCE_VERSION = '2.3.999-dev+source'; /** * Version number of the internal composer-runtime-api package