From cdcce1fc69d26456a709f950e68ca573ef6f8f66 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Mon, 26 Mar 2018 23:55:11 +0300 Subject: [PATCH 1/2] Support phpdbg SAPI in Debug::enable() PHPDBG is a CLI PHP debugger which could be useful for debugging in development or for running PHPUnit tests with code coverage faster compared to XDebug. It has CLI characteristics, but it runs as a different SAPI. --- src/Symfony/Component/Debug/CHANGELOG.md | 5 +++++ src/Symfony/Component/Debug/Debug.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Debug/CHANGELOG.md b/src/Symfony/Component/Debug/CHANGELOG.md index 31f0de9c23fb6..5b14f9031f42d 100644 --- a/src/Symfony/Component/Debug/CHANGELOG.md +++ b/src/Symfony/Component/Debug/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +2.7.1 +----- + +* fix support for PHPDBG SAPI in `Debug::enable()` + 2.7.0 ----- diff --git a/src/Symfony/Component/Debug/Debug.php b/src/Symfony/Component/Debug/Debug.php index 2075d39e3409e..1e29d45826d66 100644 --- a/src/Symfony/Component/Debug/Debug.php +++ b/src/Symfony/Component/Debug/Debug.php @@ -45,7 +45,7 @@ public static function enable($errorReportingLevel = null, $displayErrors = true error_reporting(-1); } - if ('cli' !== PHP_SAPI) { + if (!in_array(PHP_SAPI, array('cli', 'phpdbg'))) { ini_set('display_errors', 0); ExceptionHandler::register(); } elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) { From 4796f31df4b9c9ce5d85b0a8287a46a3075b812c Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Tue, 27 Mar 2018 00:59:32 +0300 Subject: [PATCH 2/2] Revert changelog entry for bugfix --- src/Symfony/Component/Debug/CHANGELOG.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Symfony/Component/Debug/CHANGELOG.md b/src/Symfony/Component/Debug/CHANGELOG.md index 5b14f9031f42d..31f0de9c23fb6 100644 --- a/src/Symfony/Component/Debug/CHANGELOG.md +++ b/src/Symfony/Component/Debug/CHANGELOG.md @@ -1,11 +1,6 @@ CHANGELOG ========= -2.7.1 ------ - -* fix support for PHPDBG SAPI in `Debug::enable()` - 2.7.0 -----