Skip to content

Commit 09d4ed5

Browse files
committed
don't reference utilities until autoloader initialized!
1 parent afdc38d commit 09d4ed5

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/Debug/Debug.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function __construct($cfg = array(), EventManager $eventManager = null, E
123123
'outputSent' => false,
124124
'profileAutoInc' => 1,
125125
'profileInstances' => array(),
126-
'requestId' => $this->utilities->requestId(),
126+
'requestId' => '', // set below
127127
'runtime' => array(
128128
// memoryPeakUsage, memoryLimit, & memoryLimit get stored here
129129
),
@@ -177,6 +177,7 @@ public function __construct($cfg = array(), EventManager $eventManager = null, E
177177
} else {
178178
$this->setLogDest();
179179
$this->data['entryCountInitial'] = \count($this->data['log']);
180+
$this->data['requestId'] = $this->utilities->requestId();
180181
}
181182
/*
182183
Initialize Internal

src/Debug/Utilities.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,11 @@ public static function getIncludedFiles()
383383
public static function getInterface()
384384
{
385385
$return = 'http';
386+
$argv = isset($_SERVER['argv']) ? $_SERVER['argv'] : array();
387+
$queryString = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
386388
$isCliOrCron = \count(\array_filter(array(
387-
\defined('STDIN'),
388-
isset($_SERVER['argv']),
389+
// have argv and it's not query_string
390+
$argv && $argv !== array($queryString),
389391
!\array_key_exists('REQUEST_METHOD', $_SERVER),
390392
))) > 0;
391393
if ($isCliOrCron) {

0 commit comments

Comments
 (0)