Pass start time to selectQuery

This commit is contained in:
Jakub Vrana 2018-02-01 11:54:39 +01:00
parent ebb23a7a88
commit d667f585e0
5 changed files with 8 additions and 8 deletions

View file

@ -148,7 +148,7 @@ if (isset($_GET["elastic"])) {
$start = microtime(true);
$search = $this->_conn->query($query, $data);
if ($print) {
echo $adminer->selectQuery("$query: " . print_r($data, true), format_time($start));
echo $adminer->selectQuery("$query: " . print_r($data, true), $start);
}
if (!$search) {
return false;

View file

@ -202,12 +202,12 @@ class Adminer {
/** Query printed in select before execution
* @param string query to be executed
* @param string elapsed time
* @param float start time of the query
* @return string
*/
function selectQuery($query, $time) {
function selectQuery($query, $start) {
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>" : "")
;
$print = "</p>\n"; // required for IE9 inline edit

View file

@ -37,7 +37,7 @@
$start = microtime(true);
$return = $this->_conn->query($query);
if ($print) {
echo $adminer->selectQuery($query, format_time($start));
echo $adminer->selectQuery($query, $start);
}
return $return;
}

View file

@ -140,8 +140,8 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
}
}
function selectQuery($query, $time) {
return "<!--\n" . str_replace("--", "--><!-- ", $query) . "\n($time)\n-->\n";
function selectQuery($query, $start) {
return "<!--\n" . str_replace("--", "--><!-- ", $query) . "\n(" . format_time($start) . ")\n-->\n";
}
function rowDescription($table) {

View file

@ -182,7 +182,7 @@ class AdminerPlugin extends Adminer {
return $this->_applyPlugin(__FUNCTION__, $args);
}
function selectQuery($query, $time) {
function selectQuery($query, $start) {
$args = func_get_args();
return $this->_applyPlugin(__FUNCTION__, $args);
}