Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: composer/composer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.10.4
Choose a base ref
...
head repository: composer/composer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.10.5
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Apr 10, 2020

  1. Verified

    This commit was signed with the committer’s verified signature.
    veprbl Dmitry Kalinkin
    Copy the full SHA
    b3dbd95 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Ma27 Maximilian Bosch
    Copy the full SHA
    2f7e901 View commit details
  3. Update changelog

    Seldaek committed Apr 10, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Ma27 Maximilian Bosch
    Copy the full SHA
    8e2e9ca View commit details
  4. Release 1.10.5

    Seldaek committed Apr 10, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    Ma27 Maximilian Bosch
    Copy the full SHA
    7a4d5b6 View commit details
Showing with 24 additions and 14 deletions.
  1. +6 −0 CHANGELOG.md
  2. +1 −1 src/Composer/Command/SelfUpdateCommand.php
  3. +6 −6 src/Composer/Composer.php
  4. +8 −4 src/Composer/EventDispatcher/EventDispatcher.php
  5. +3 −3 src/Composer/SelfUpdate/Versions.php
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### [1.10.5] 2020-04-10

* Fixed self-update on PHP <5.6, seriously please upgrade people, it's time
* Fixed 1.10.2 regression with PATH resolution in scripts

### [1.10.4] 2020-04-09

* Fixed 1.10.2 regression in path symlinking with absolute path repos
@@ -841,6 +846,7 @@

* Initial release

[1.10.5]: https://github.com/composer/composer/compare/1.10.4...1.10.5
[1.10.4]: https://github.com/composer/composer/compare/1.10.3...1.10.4
[1.10.3]: https://github.com/composer/composer/compare/1.10.2...1.10.3
[1.10.2]: https://github.com/composer/composer/compare/1.10.1...1.10.2
2 changes: 1 addition & 1 deletion src/Composer/Command/SelfUpdateCommand.php
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

// switch channel if requested
$requestedChannel = null;
foreach (Versions::CHANNELS as $channel) {
foreach (Versions::$channels as $channel) {
if ($input->getOption($channel)) {
$requestedChannel = $channel;
$versionsUtil->setChannel($channel);
12 changes: 6 additions & 6 deletions src/Composer/Composer.php
Original file line number Diff line number Diff line change
@@ -45,14 +45,14 @@ class Composer
* const SOURCE_VERSION = '';
*
* source (git clone):
* const VERSION = '@package_version@';
* const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@';
* const RELEASE_DATE = '@release_date@';
* const VERSION = '1.10.5';
* const BRANCH_ALIAS_VERSION = '';
* const RELEASE_DATE = '2020-04-10 11:44:22';
* 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 VERSION = '1.10.5';
const BRANCH_ALIAS_VERSION = '';
const RELEASE_DATE = '2020-04-10 11:44:22';
const SOURCE_VERSION = '1.10-dev+source';

public static function getVersion()
12 changes: 8 additions & 4 deletions src/Composer/EventDispatcher/EventDispatcher.php
Original file line number Diff line number Diff line change
@@ -247,6 +247,13 @@ protected function doDispatch(Event $event)
}
}

// if composer is being executed, make sure it runs the expected composer from current path
// resolution, even if bin-dir contains composer too because the project requires composer/composer
// see https://github.com/composer/composer/issues/8748
if (substr($exec, 0, 9) === 'composer ') {
$exec = $this->getPhpExecCommand() . ' ' . ProcessExecutor::escape(getenv('COMPOSER_BINARY')) . substr($exec, 8);
}

if (0 !== ($exitCode = $this->process->execute($exec))) {
$this->io->writeError(sprintf('<error>Script %s handling the %s event returned with error code '.$exitCode.'</error>', $callable, $event->getName()), true, IOInterface::QUIET);

@@ -547,10 +554,7 @@ private function ensureBinDirIsInPath()
if (is_dir($binDir)) {
$binDir = realpath($binDir);
if (isset($_SERVER[$pathStr]) && !preg_match('{(^|'.PATH_SEPARATOR.')'.preg_quote($binDir).'($|'.PATH_SEPARATOR.')}', $_SERVER[$pathStr])) {
// prepend the COMPOSER_BINARY dir to the path to make sure that scripts running "composer" will run the expected composer
// from current path resolution, even if bin-dir contains composer too because the project requires composer/composer
// see https://github.com/composer/composer/issues/8748
$_SERVER[$pathStr] = dirname(getenv('COMPOSER_BINARY')).PATH_SEPARATOR.$binDir.PATH_SEPARATOR.getenv($pathStr);
$_SERVER[$pathStr] = $binDir.PATH_SEPARATOR.getenv($pathStr);
putenv($pathStr.'='.$_SERVER[$pathStr]);
}
}
6 changes: 3 additions & 3 deletions src/Composer/SelfUpdate/Versions.php
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
*/
class Versions
{
const CHANNELS = array('stable', 'preview', 'snapshot', '1', '2');
public static $channels = array('stable', 'preview', 'snapshot', '1', '2');

private $rfs;
private $config;
@@ -52,8 +52,8 @@ public function getChannel()

public function setChannel($channel)
{
if (!in_array($channel, self::CHANNELS, true)) {
throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::CHANNELS));
if (!in_array($channel, self::$channels, true)) {
throw new \InvalidArgumentException('Invalid channel '.$channel.', must be one of: ' . implode(', ', self::$channels));
}

$channelFile = $this->config->get('home').'/update-channel';