From e1b8722bfa195c6fcb4a2e342b8eac9847d835db Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Fri, 9 Apr 2021 18:44:29 +0100 Subject: [PATCH 1/3] Update 00-intro.md --- doc/00-intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/00-intro.md b/doc/00-intro.md index 45f3f55c6..8afd60090 100644 --- a/doc/00-intro.md +++ b/doc/00-intro.md @@ -155,7 +155,7 @@ Close your current terminal. Test usage with a new terminal: ```sh C:\Users\username>composer -V -Composer version 1.0.0 2016-01-10 20:34:53 +Composer version 2.0.12 2021-04-01 10:14:59 ``` ## Using Composer From 53a4725dbef775a7d6c0e375d8962934354b12e2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 18 Apr 2021 23:10:17 +0200 Subject: [PATCH 2/3] Fix source links, fixes #9836 --- doc/articles/scripts.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/articles/scripts.md b/doc/articles/scripts.md index 9b5ca4a88..e5627b100 100644 --- a/doc/articles/scripts.md +++ b/doc/articles/scripts.md @@ -177,15 +177,15 @@ Depending on the [script types](#event-names) you will get various event subclasses containing various getters with relevant data and associated objects: -- Base class: [`Composer\EventDispatcher\Event`](https://getcomposer.org/apidoc/master/Composer/EventDispatcher/Event.html) -- Command Events: [`Composer\Script\Event`](https://getcomposer.org/apidoc/master/Composer/Script/Event.html) -- Installer Events: [`Composer\Installer\InstallerEvent`](https://getcomposer.org/apidoc/master/Composer/Installer/InstallerEvent.html) -- Package Events: [`Composer\Installer\PackageEvent`](https://getcomposer.org/apidoc/master/Composer/Installer/PackageEvent.html) +- Base class: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/Event.php) +- Command Events: [`Composer\Script\Event`](https://github.com/composer/composer/blob/master/src/Composer/Script/Event.php) +- Installer Events: [`Composer\Installer\InstallerEvent`](https://github.com/composer/composer/blob/master/src/Composer/Installer/InstallerEvent.php) +- Package Events: [`Composer\Installer\PackageEvent`](https://github.com/composer/composer/blob/master/src/Composer/Installer/PackageEvent.php) - Plugin Events: - - init: [`Composer\EventDispatcher\Event`](https://getcomposer.org/apidoc/master/Composer/EventDispatcher/Event.html) - - command: [`Composer\Plugin\CommandEvent`](https://getcomposer.org/apidoc/master/Composer/Plugin/CommandEvent.html) - - pre-file-download: [`Composer\Plugin\PreFileDownloadEvent`](https://getcomposer.org/apidoc/master/Composer/Plugin/PreFileDownloadEvent.html) - - post-file-download: [`Composer\Plugin\PostFileDownloadEvent`](https://getcomposer.org/apidoc/master/Composer/Plugin/PostFileDownloadEvent.html) + - init: [`Composer\EventDispatcher\Event`](https://github.com/composer/composer/blob/master/src/Composer/EventDispatcher/Event.php) + - command: [`Composer\Plugin\CommandEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/CommandEvent.php) + - pre-file-download: [`Composer\Plugin\PreFileDownloadEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/PreFileDownloadEvent.php) + - post-file-download: [`Composer\Plugin\PostFileDownloadEvent`](https://github.com/composer/composer/blob/master/src/Composer/Plugin/PostFileDownloadEvent.php) ## Running scripts manually From 99d8e0ad09a5091a1e906c35225bb3372207f6f1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 20 Apr 2021 22:00:01 +0200 Subject: [PATCH 3/3] Fix install step at the end of init command --- src/Composer/Command/InitCommand.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 30e30dcfa..6c148d0f5 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -157,7 +157,7 @@ EOT $question = 'Would you like to install dependencies now [yes]? '; if ($input->isInteractive() && $this->hasDependencies($options) && $io->askConfirmation($question)) { - $this->installDependencies($output); + $this->updateDependencies($output); } return 0; @@ -837,13 +837,14 @@ EOT return array_keys(array_slice($similarPackages, 0, 5)); } - private function installDependencies($output) + private function updateDependencies($output) { try { - $installCommand = $this->getApplication()->find('install'); - $installCommand->run(new ArrayInput(array()), $output); + $updateCommand = $this->getApplication()->find('update'); + $this->getApplication()->resetComposer(); + $updateCommand->run(new ArrayInput(array()), $output); } catch (\Exception $e) { - $this->getIO()->writeError('Could not install dependencies. Run `composer install` to see more information.'); + $this->getIO()->writeError('Could not update dependencies. Run `composer update` to see more information.'); } }