]> git.joonet.de Git - adminer.git/commitdiff
Pass start time to selectQuery
authorJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 10:54:39 +0000 (11:54 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 1 Feb 2018 10:54:56 +0000 (11:54 +0100)
adminer/drivers/elastic.inc.php
adminer/include/adminer.inc.php
adminer/include/driver.inc.php
editor/include/adminer.inc.php
plugins/plugin.php

index 2f8fd276c96bdda03cb094d7f322b03027aa83e3..00be43258db991984a73dc1cc97a6dd00efc081f 100644 (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;
index c28881e943c78bfd264bd2b4e11674a5fa904bf0..3a01c85aee5382b7fd9356639b657ed851325f53 100644 (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
index 2c66a36315c3c9c41eba815fe5fdb033975e2dfb..1963390aa1f2a9b6e3d0ed6fcdd993e603ea960a 100644 (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;
        }
index 1da44c473975b9ca6425e22f93e163983a4f5e57..4fec8a90ae22f6ac3d799dcd6f77aa573b2ddcfc 100644 (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) {
index 11aca9aaad4f2c5cd5bfce8c9bb5387d41b4569e..9617fe5bceb06e1ad8047ef05635cef6a964f2c2 100644 (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);
        }