treat phpdbg the same as php-cli

This commit is contained in:
Shish 2018-07-15 19:40:53 +01:00
parent 2417b5b021
commit 8b2c580930
2 changed files with 3 additions and 3 deletions

View file

@ -1113,7 +1113,7 @@ function log_msg(string $section, int $priority, string $message, $flash=false,
send_event(new LogEvent($section, $priority, $message, $args)); send_event(new LogEvent($section, $priority, $message, $args));
$threshold = defined("CLI_LOG_LEVEL") ? CLI_LOG_LEVEL : 0; $threshold = defined("CLI_LOG_LEVEL") ? CLI_LOG_LEVEL : 0;
if((PHP_SAPI === 'cli') && ($priority >= $threshold)) { if((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && ($priority >= $threshold)) {
print date("c")." $section: $message\n"; print date("c")." $section: $message\n";
} }
if($flash === true) { if($flash === true) {
@ -1639,7 +1639,7 @@ function _sanitise_environment() {
ob_start(); ob_start();
if(PHP_SAPI === 'cli') { if(PHP_SAPI === 'cli' || PHP_SAPI == 'phpdbg') {
if(isset($_SERVER['REMOTE_ADDR'])) { if(isset($_SERVER['REMOTE_ADDR'])) {
die("CLI with remote addr? Confused, not taking the risk."); die("CLI with remote addr? Confused, not taking the risk.");
} }

View file

@ -91,7 +91,7 @@ try {
// start the page generation waterfall // start the page generation waterfall
$user = _get_user(); $user = _get_user();
if(PHP_SAPI === 'cli') { if(PHP_SAPI === 'cli' || PHP_SAPI == 'phpdbg') {
send_event(new CommandEvent($argv)); send_event(new CommandEvent($argv));
} }
else { else {