From 288631a37e29b48574611639eae69d42e0e9bcb5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 12 Apr 2018 19:42:23 +0200 Subject: [PATCH 1/3] Log the source of the failure when an aliased script fails, fixes #7201 --- src/Composer/EventDispatcher/EventDispatcher.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 4a5656d9f..2a180614c 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -186,7 +186,12 @@ class EventDispatcher $this->io->writeError(sprintf('You made a reference to a non-existent script %s', $callable), true, IOInterface::QUIET); } - $return = $this->dispatch($scriptName, new Script\Event($scriptName, $event->getComposer(), $event->getIO(), $event->isDevMode(), $args, $flags)); + try { + $return = $this->dispatch($scriptName, new Script\Event($scriptName, $event->getComposer(), $event->getIO(), $event->isDevMode(), $args, $flags)); + } catch (ScriptExecutionException $e) { + $this->io->writeError(sprintf('Script %s was called via %s', $callable, $event->getName()), true, IOInterface::QUIET); + throw $e; + } } } elseif ($this->isPhpScript($callable)) { $className = substr($callable, 0, strpos($callable, '::')); From 24ef605473cc0ee79e8bed1041ecc8ff67f86c42 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 12 Apr 2018 19:49:18 +0200 Subject: [PATCH 2/3] Clarify that #refs is root-only, fixes #7241 --- doc/04-schema.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/04-schema.md b/doc/04-schema.md index c338b4673..250b4e415 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -307,7 +307,9 @@ releases for the `doctrine/data-fixtures` package : `require` and `require-dev` additionally support explicit references (i.e. commit) for dev versions to make sure they are locked to a given state, even when you run update. These only work if you explicitly require a dev version -and append the reference with `#`. +and append the reference with `#`. This is also a +[root-only](04-schema.md#root-package) feature and will be ignored in +dependencies. Example: From fa539766b8ce217fed1d617db2f17aca8cfcf20e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 12 Apr 2018 19:56:35 +0200 Subject: [PATCH 3/3] Output outdated warning on stderr, fixes #7218 --- 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 ae2307e5c..ec0261acc 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -467,7 +467,7 @@ EOT } $io->write(''); if (isset($package['warning'])) { - $io->write('' . $package['warning'] . ''); + $io->writeError('' . $package['warning'] . ''); } }