From 800a4bf39176b02147fec100df9c53a167a110e3 Mon Sep 17 00:00:00 2001 From: msiebeneicher Date: Fri, 21 Oct 2016 13:57:02 +0200 Subject: [PATCH 1/4] fixed direct rename() usage for v1.2 --- src/Composer/Package/Archiver/ArchiveManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Package/Archiver/ArchiveManager.php b/src/Composer/Package/Archiver/ArchiveManager.php index 3ff3f2e98..52fe7bed3 100644 --- a/src/Composer/Package/Archiver/ArchiveManager.php +++ b/src/Composer/Package/Archiver/ArchiveManager.php @@ -164,7 +164,7 @@ class ArchiveManager $filesystem->ensureDirectoryExists(dirname($tempTarget)); $archivePath = $usableArchiver->archive($sourcePath, $tempTarget, $format, $package->getArchiveExcludes()); - rename($archivePath, $target); + $filesystem->rename($archivePath, $target); // cleanup temporary download if (!$package instanceof RootPackageInterface) { From 6de7feeb8662e705d8d961527efb0019fd413d5f Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Tue, 25 Oct 2016 09:54:03 +0200 Subject: [PATCH 2/4] Fix crash when listing root package without versions When using certain parameters together in 'composer show', specifically '-s --outdated', the root package itself is inspected for its latest version. If the git repository it belongs to does not have any tags yet this would return FALSE, while the next call to printMeta requires a PackageInterface or NULL, causing a crash. Refs #5808 --- src/Composer/Command/ShowCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index b00348f08..e36fed258 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -178,7 +178,7 @@ EOT if ($input->getOption('latest')) { $latestPackage = $this->findLatestPackage($package, $composer, $phpVersion); } - $this->printMeta($package, $versions, $installedRepo, $latestPackage); + $this->printMeta($package, $versions, $installedRepo, $latestPackage ?: null); $this->printLinks($package, 'requires'); $this->printLinks($package, 'devRequires', 'requires (dev)'); if ($package->getSuggests()) { From 5d742fd38b93465cb2bc296c19c93ab7329a911a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 30 Oct 2016 13:35:13 -0700 Subject: [PATCH 3/4] Fix POST_DEPENDENCIES_SOLVING trigger --- src/Composer/Installer.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 49e82f06c..b0c4756c9 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -459,7 +459,6 @@ class Installer $solver = new Solver($policy, $pool, $installedRepo, $this->io); try { $operations = $solver->solve($request, $this->ignorePlatformReqs); - $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::POST_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request, $operations); } catch (SolverProblemsException $e) { $this->io->writeError('Your requirements could not be resolved to an installable set of packages.', true, IOInterface::QUIET); $this->io->writeError($e->getMessage()); @@ -467,12 +466,14 @@ class Installer return array(max(1, $e->getCode()), array()); } - $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE); - $this->io->writeError("Analyzed ".$solver->getRuleSetSize()." rules to resolve dependencies", true, IOInterface::VERBOSE); - // force dev packages to be updated if we update or install from a (potentially new) lock $operations = $this->processDevPackages($localRepo, $pool, $policy, $repositories, $installedRepo, $lockedRepository, 'force-updates', $operations); + $this->eventDispatcher->dispatchInstallerEvent(InstallerEvents::POST_DEPENDENCIES_SOLVING, $this->devMode, $policy, $pool, $installedRepo, $request, $operations); + + $this->io->writeError("Analyzed ".count($pool)." packages to resolve dependencies", true, IOInterface::VERBOSE); + $this->io->writeError("Analyzed ".$solver->getRuleSetSize()." rules to resolve dependencies", true, IOInterface::VERBOSE); + // execute operations if (!$operations) { $this->io->writeError('Nothing to install or update'); From f99a33bfc75b075fe1ad8ef375ba17706bb61bb5 Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Mon, 31 Oct 2016 16:26:37 +0100 Subject: [PATCH 4/4] Clarify documentation that commit refs are unsupported Following the discussion in #5823 it has become clear that this feature is supplied at-your-own-risk, this should be more explicitly reflected in its documentation. --- doc/04-schema.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/04-schema.md b/doc/04-schema.md index 7ee14958c..5a0f7ccc5 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -316,12 +316,12 @@ Example: } ``` -> **Note:** While this is convenient at times, it should not be how you use -> packages in the long term because it comes with a technical limitation. The +> **Note:** This feature has severe technical limitations, as the > composer.json metadata will still be read from the branch name you specify -> before the hash. Because of that in some cases it will not be a practical -> workaround, and you should always try to switch to tagged releases as soon -> as you can. +> before the hash. You should therefore only use this as a temporary solution +> during development to remediate transient issues, until you can switch to +> tagged releases. The Composer team does not actively support this feature +> and will not accept bug reports related to it. It is also possible to inline-alias a package constraint so that it matches a constraint that it otherwise would not. For more information [see the