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
This commit is contained in:
commit
01fb26b4d2
@ -80,7 +80,7 @@ Use the <info>--parameters</info> option to display all parameters:
|
|||||||
|
|
||||||
<info>php %command.full_name% --parameters</info>
|
<info>php %command.full_name% --parameters</info>
|
||||||
|
|
||||||
Display a specific parameter by specifying his name with the <info>--parameter</info> option:
|
Display a specific parameter by specifying its name with the <info>--parameter</info> option:
|
||||||
|
|
||||||
<info>php %command.full_name% --parameter=kernel.debug</info>
|
<info>php %command.full_name% --parameter=kernel.debug</info>
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class StreamOutput extends Output
|
|||||||
*
|
*
|
||||||
* Colorization is disabled if not supported by the stream:
|
* Colorization is disabled if not supported by the stream:
|
||||||
*
|
*
|
||||||
* - Windows without Ansicon, ConEmu or Mintty
|
* - Windows before 10.0.10586 without Ansicon, ConEmu or Mintty
|
||||||
* - non tty consoles
|
* - non tty consoles
|
||||||
*
|
*
|
||||||
* @return bool true if the stream supports colorization, false otherwise
|
* @return bool true if the stream supports colorization, false otherwise
|
||||||
@ -91,7 +91,11 @@ class StreamOutput extends Output
|
|||||||
protected function hasColorSupport()
|
protected function hasColorSupport()
|
||||||
{
|
{
|
||||||
if (DIRECTORY_SEPARATOR === '\\') {
|
if (DIRECTORY_SEPARATOR === '\\') {
|
||||||
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
|
return
|
||||||
|
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
|
||||||
|
|| false !== getenv('ANSICON')
|
||||||
|
|| 'ON' === getenv('ConEmuANSI')
|
||||||
|
|| 'xterm' === getenv('TERM');
|
||||||
}
|
}
|
||||||
|
|
||||||
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
||||||
|
@ -116,6 +116,10 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
|
|||||||
$event = new Event();
|
$event = new Event();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (null !== $this->logger && $event->isPropagationStopped()) {
|
||||||
|
$this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
|
||||||
|
}
|
||||||
|
|
||||||
$this->preProcess($eventName);
|
$this->preProcess($eventName);
|
||||||
$this->preDispatch($eventName, $event);
|
$this->preDispatch($eventName, $event);
|
||||||
|
|
||||||
|
@ -155,10 +155,10 @@ class EventDispatcher implements EventDispatcherInterface
|
|||||||
protected function doDispatch($listeners, $eventName, Event $event)
|
protected function doDispatch($listeners, $eventName, Event $event)
|
||||||
{
|
{
|
||||||
foreach ($listeners as $listener) {
|
foreach ($listeners as $listener) {
|
||||||
call_user_func($listener, $event, $eventName, $this);
|
|
||||||
if ($event->isPropagationStopped()) {
|
if ($event->isPropagationStopped()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
call_user_func($listener, $event, $eventName, $this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user