Pass start time to selectQuery
This commit is contained in:
parent
ebb23a7a88
commit
d667f585e0
|
@ -148,7 +148,7 @@ if (isset($_GET["elastic"])) {
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
$search = $this->_conn->query($query, $data);
|
$search = $this->_conn->query($query, $data);
|
||||||
if ($print) {
|
if ($print) {
|
||||||
echo $adminer->selectQuery("$query: " . print_r($data, true), format_time($start));
|
echo $adminer->selectQuery("$query: " . print_r($data, true), $start);
|
||||||
}
|
}
|
||||||
if (!$search) {
|
if (!$search) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -202,12 +202,12 @@ class Adminer {
|
||||||
|
|
||||||
/** Query printed in select before execution
|
/** Query printed in select before execution
|
||||||
* @param string query to be executed
|
* @param string query to be executed
|
||||||
* @param string elapsed time
|
* @param float start time of the query
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function selectQuery($query, $time) {
|
function selectQuery($query, $start) {
|
||||||
global $jush, $driver;
|
global $jush, $driver;
|
||||||
$return = "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <span class='time'>($time)</span>"
|
$return = "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <span class='time'>(" . format_time($time) . ")</span>"
|
||||||
. (support("sql") ? " <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>" : "")
|
. (support("sql") ? " <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>" : "")
|
||||||
;
|
;
|
||||||
$print = "</p>\n"; // required for IE9 inline edit
|
$print = "</p>\n"; // required for IE9 inline edit
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
$return = $this->_conn->query($query);
|
$return = $this->_conn->query($query);
|
||||||
if ($print) {
|
if ($print) {
|
||||||
echo $adminer->selectQuery($query, format_time($start));
|
echo $adminer->selectQuery($query, $start);
|
||||||
}
|
}
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,8 +140,8 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectQuery($query, $time) {
|
function selectQuery($query, $start) {
|
||||||
return "<!--\n" . str_replace("--", "--><!-- ", $query) . "\n($time)\n-->\n";
|
return "<!--\n" . str_replace("--", "--><!-- ", $query) . "\n(" . format_time($start) . ")\n-->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function rowDescription($table) {
|
function rowDescription($table) {
|
||||||
|
|
|
@ -182,7 +182,7 @@ class AdminerPlugin extends Adminer {
|
||||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectQuery($query, $time) {
|
function selectQuery($query, $start) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
return $this->_applyPlugin(__FUNCTION__, $args);
|
return $this->_applyPlugin(__FUNCTION__, $args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue