Skip to content

Commit 01fb26b

Browse files
Merge branch '2.3' into 2.7
* 2.3: Detect CLI color support for Windows 10 build 10586 [EventDispatcher] Try first if the event is Stopped [FrameworkBundle] fixes grammar in container:debug command manual. Conflicts: src/Symfony/Component/EventDispatcher/EventDispatcher.php src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
2 parents eb23f05 + 5fbfcb0 commit 01fb26b

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function configure()
8080
8181
<info>php %command.full_name% --parameters</info>
8282
83-
Display a specific parameter by specifying his name with the <info>--parameter</info> option:
83+
Display a specific parameter by specifying its name with the <info>--parameter</info> option:
8484
8585
<info>php %command.full_name% --parameter=kernel.debug</info>
8686

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,19 @@ protected function doWrite($message, $newline)
8383
*
8484
* Colorization is disabled if not supported by the stream:
8585
*
86-
* - Windows without Ansicon, ConEmu or Mintty
86+
* - Windows before 10.0.10586 without Ansicon, ConEmu or Mintty
8787
* - non tty consoles
8888
*
8989
* @return bool true if the stream supports colorization, false otherwise
9090
*/
9191
protected function hasColorSupport()
9292
{
9393
if (DIRECTORY_SEPARATOR === '\\') {
94-
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
94+
return
95+
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
96+
|| false !== getenv('ANSICON')
97+
|| 'ON' === getenv('ConEmuANSI')
98+
|| 'xterm' === getenv('TERM');
9599
}
96100

97101
return function_exists('posix_isatty') && @posix_isatty($this->stream);

src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ public function dispatch($eventName, Event $event = null)
116116
$event = new Event();
117117
}
118118

119+
if (null !== $this->logger && $event->isPropagationStopped()) {
120+
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
121+
}
122+
119123
$this->preProcess($eventName);
120124
$this->preDispatch($eventName, $event);
121125

src/Symfony/Component/EventDispatcher/EventDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
155155
protected function doDispatch($listeners, $eventName, Event $event)
156156
{
157157
foreach ($listeners as $listener) {
158-
call_user_func($listener, $event, $eventName, $this);
159158
if ($event->isPropagationStopped()) {
160159
break;
161160
}
161+
call_user_func($listener, $event, $eventName, $this);
162162
}
163163
}
164164

0 commit comments

Comments
 (0)