Browse Source

Ensure that all checks for cli also include support for phpdbg

Walther Lalk 10 years ago
parent
commit
084e9abdff
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/Core/functions.php
  2. 1 1
      src/Error/BaseErrorHandler.php

+ 2 - 2
src/Core/functions.php

@@ -138,7 +138,7 @@ if (!function_exists('pr')) {
             return;
         }
 
-        $template = PHP_SAPI !== 'cli' ? '<pre class="pr">%s</pre>' : "\n%s\n\n";
+        $template = (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') ? '<pre class="pr">%s</pre>' : "\n%s\n\n";
         printf($template, trim(print_r($var, true)));
     }
 
@@ -162,7 +162,7 @@ if (!function_exists('pj')) {
             return;
         }
 
-        $template = PHP_SAPI !== 'cli' ? '<pre class="pj">%s</pre>' : "\n%s\n\n";
+        $template = (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') ? '<pre class="pj">%s</pre>' : "\n%s\n\n";
         printf($template, trim(json_encode($var, JSON_PRETTY_PRINT)));
     }
 

+ 1 - 1
src/Error/BaseErrorHandler.php

@@ -292,7 +292,7 @@ abstract class BaseErrorHandler
                 $message .= "\nException Attributes: " . var_export($exception->getAttributes(), true);
             }
         }
-        if (PHP_SAPI !== 'cli') {
+        if ((PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg')) {
             $request = Router::getRequest();
             if ($request) {
                 $message .= "\nRequest URL: " . $request->here();