diff --git a/Resources/functions/dump.php b/Resources/functions/dump.php index a0e5addf..f2ff74c0 100644 --- a/Resources/functions/dump.php +++ b/Resources/functions/dump.php @@ -45,7 +45,7 @@ function dump(mixed ...$vars): mixed if (!function_exists('dd')) { function dd(mixed ...$vars): never { - if (!in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !headers_sent()) { + if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) && !headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } diff --git a/VarDumper.php b/VarDumper.php index cfc6b280..baff2115 100644 --- a/VarDumper.php +++ b/VarDumper.php @@ -85,11 +85,11 @@ private static function register(): void case 'server' === $format: case $format && 'tcp' === parse_url($format, \PHP_URL_SCHEME): $host = 'server' === $format ? $_SERVER['VAR_DUMPER_SERVER'] ?? '127.0.0.1:9912' : $format; - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); + $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) ? new CliDumper() : new HtmlDumper(); $dumper = new ServerDumper($host, $dumper, self::getDefaultContextProviders()); break; default: - $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliDumper() : new HtmlDumper(); + $dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) ? new CliDumper() : new HtmlDumper(); } if (!$dumper instanceof ServerDumper) { @@ -111,7 +111,7 @@ private static function getDefaultContextProviders(): array { $contextProviders = []; - if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && class_exists(Request::class)) { + if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) && class_exists(Request::class)) { $requestStack = new RequestStack(); $requestStack->push(Request::createFromGlobals()); $contextProviders['request'] = new RequestContextProvider($requestStack);