Page MenuHomeIn-Portal Phabricator

D429.diff
No OneTemporary

File Metadata

Created
Mon, Jan 6, 2:20 AM

D429.diff

Index: branches/5.2.x/core/kernel/utility/debugger.php
===================================================================
--- branches/5.2.x/core/kernel/utility/debugger.php
+++ branches/5.2.x/core/kernel/utility/debugger.php
@@ -252,6 +252,13 @@
private $Data = Array ();
/**
+ * Data index, that represents a header ending.
+ *
+ * @var integer
+ */
+ private $HeaderEndingDataIndex = 0;
+
+ /**
* Holds information about each profiler record (start/end/description)
*
* @var Array
@@ -427,7 +434,8 @@
// vertical scrollbar width differs in Firefox and other browsers
$this->scrollbarWidth = $this->isGecko() ? 22 : 25;
- $this->appendRequest();
+ // Mark place, where request information will be inserted.
+ $this->HeaderEndingDataIndex = count($this->Data);
}
/**
@@ -1120,6 +1128,28 @@
}
/**
+ * Inserts HTML code without transformations at given position
+ *
+ * @param string $html HTML.
+ * @param integer $position Position.
+ *
+ * @return integer
+ */
+ public function insertHTML($html, $position)
+ {
+ array_splice(
+ $this->Data,
+ $position,
+ 0,
+ array(
+ array('html' => $html, 'debug_type' => 'html'),
+ )
+ );
+
+ return $position + 1;
+ }
+
+ /**
* Returns instance of FirePHP class
*
* @return FirePHP
@@ -1209,9 +1239,18 @@
$script = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['PHP_SELF'];
}
- $this->appendHTML('ScriptName: <b>' . $this->getFileLink($script, 1, basename($script)) . '</b> (<b>' . dirname($script) . '</b>)');
+ $insert_at_index = $this->HeaderEndingDataIndex;
+
+ $insert_at_index = $this->insertHTML(
+ 'ScriptName: <b>' . $this->getFileLink($script, 1, basename($script)) . '</b> (<b>' . dirname($script) . '</b>)',
+ $insert_at_index
+ );
+
if ( $this->_isAjax ) {
- $this->appendHTML('RequestURI: ' . $_SERVER['REQUEST_URI'] . ' (QS Length:' . strlen($_SERVER['QUERY_STRING']) . ')');
+ $insert_at_index = $this->insertHTML(
+ 'RequestURI: ' . $_SERVER['REQUEST_URI'] . ' (QS Length:' . strlen($_SERVER['QUERY_STRING']) . ')',
+ $insert_at_index
+ );
}
$tools_html = ' <table style="width: ' . $this->getWindowWidth() . 'px;">
@@ -1220,7 +1259,7 @@
<td>' . $this->_getToolsHTML() . '</td>
</tr>
</table>';
- $this->appendHTML($tools_html);
+ $insert_at_index = $this->insertHTML($tools_html, $insert_at_index);
ob_start();
?>
@@ -1229,7 +1268,16 @@
<td width="20">Src</td><td>Name</td><td>Value</td>
</thead>
<?php
- $super_globals = Array ('GE' => $_GET, 'PO' => $_POST, 'CO' => $_COOKIE);
+ if ( is_object($this->Application) ) {
+ $super_globals = array(
+ 'GE' => $this->Application->HttpQuery->Get,
+ 'PO' => $this->Application->HttpQuery->Post,
+ 'CO' => $this->Application->HttpQuery->Cookie,
+ );
+ }
+ else {
+ $super_globals = array('GE' => $_GET, 'PO' => $_POST, 'CO' => $_COOKIE);
+ }
foreach ($super_globals as $prefix => $data) {
foreach ($data as $key => $value) {
@@ -1246,7 +1294,7 @@
?>
</table>
<?php
- $this->appendHTML(ob_get_contents());
+ $this->insertHTML(ob_get_contents(), $insert_at_index);
ob_end_clean();
}
@@ -1568,6 +1616,7 @@
DebuggerUtil::safeDefine('DBG_RAISE_ON_WARNINGS', 0);
DebuggerUtil::safeDefine('DBG_TOOLBAR_BUTTONS', 1);
+ $this->appendRequest();
$this->appendSession(); // show php session if any
// ensure, that 1st line of debug output always is this one:

Event Timeline