Add PHPDbg support to HTTP components
This commit is contained in:
parent
d73f491ed5
commit
60dd79c835
@ -45,7 +45,7 @@ class Debug
|
||||
error_reporting(-1);
|
||||
}
|
||||
|
||||
if (!in_array(PHP_SAPI, array('cli', 'phpdbg'))) {
|
||||
if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) {
|
||||
ini_set('display_errors', 0);
|
||||
ExceptionHandler::register();
|
||||
} elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {
|
||||
|
@ -372,7 +372,7 @@ class Response
|
||||
|
||||
if (function_exists('fastcgi_finish_request')) {
|
||||
fastcgi_finish_request();
|
||||
} elseif ('cli' !== PHP_SAPI) {
|
||||
} elseif (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) {
|
||||
static::closeOutputBuffers(0, true);
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
--$i;
|
||||
}
|
||||
|
||||
if ('cli' !== PHP_SAPI && stripos($h[$i], 'html')) {
|
||||
if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html')) {
|
||||
$this->dumper = new HtmlDumper('php://output', $this->charset);
|
||||
} else {
|
||||
$this->dumper = new CliDumper('php://output', $this->charset);
|
||||
|
@ -44,7 +44,7 @@ class PhpExecutableFinder
|
||||
}
|
||||
|
||||
// PHP_BINARY return the current sapi executable
|
||||
if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'))) {
|
||||
if (defined('PHP_BINARY') && PHP_BINARY && \in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), true)) {
|
||||
return PHP_BINARY.$args;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ class VarDumper
|
||||
{
|
||||
if (null === self::$handler) {
|
||||
$cloner = new VarCloner();
|
||||
$dumper = in_array(PHP_SAPI, array('cli', 'phpdbg')) ? new CliDumper() : new HtmlDumper();
|
||||
$dumper = \in_array(PHP_SAPI, array('cli', 'phpdbg'), true) ? new CliDumper() : new HtmlDumper();
|
||||
self::$handler = function ($var) use ($cloner, $dumper) {
|
||||
$dumper->dump($cloner->cloneVar($var));
|
||||
};
|
||||
|
Reference in New Issue
Block a user