Changeset 709


Ignore:
Timestamp:
Jan 5, 2014, 2:07:44 PM (11 years ago)
Author:
chronos
Message:
  • Added: Print SQL per query duration in developer mode.
Location:
trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/Database.php

    r608 r709  
    6464  function query($Query)
    6565  {
     66        if($this->ShowSQLQuery == true) $QueryStartTime = microtime();
    6667    $this->LastQuery = $Query;
    67     if($this->ShowSQLQuery == true)
    68       echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.'</div>'."\n");
    6968    if($this->LogSQLQuery == true)
    7069      file_put_contents($this->LogFile, $Query."\n", FILE_APPEND);
    7170    $Result = new DatabaseResult();
    7271    $Result->PDOStatement = $this->PDO->query($Query);
     72    if($this->ShowSQLQuery == true)
     73    {
     74        $Duration = ' ; '.(microtime() - $QueryStartTime). ' s';
     75      echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.$Duration.'</div>'."\n");
     76    }
    7377    if($Result->PDOStatement)
    7478    {
  • trunk/includes/Version.php

    r708 r709  
    66// and system will need database update.
    77
    8 $Revision = 708; // Subversion revision
     8$Revision = 709; // Subversion revision
    99$DatabaseRevision = 695; // Database structure revision
    1010$ReleaseTime = '2014-01-04';
Note: See TracChangeset for help on using the changeset viewer.