Changeset 769 for trunk/includes


Ignore:
Timestamp:
Jan 31, 2014, 12:23:31 AM (11 years ago)
Author:
chronos
Message:
  • Added: Log query duration to sql log file.
Location:
trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/Database.php

    r765 r769  
    6363  function query($Query)
    6464  {
    65         if($this->ShowSQLQuery == true) $QueryStartTime = microtime();
     65        if(($this->ShowSQLQuery == true) or ($this->LogSQLQuery == true)) $QueryStartTime = microtime();
    6666    $this->LastQuery = $Query;
    67     if($this->LogSQLQuery == true)
    68       file_put_contents($this->LogFile, $Query."\n", FILE_APPEND);
    6967    $Result = new DatabaseResult();
    7068    $Result->PDOStatement = $this->PDO->query($Query);
     69    if(($this->ShowSQLQuery == true) or ($this->LogSQLQuery == true))
     70      $Duration = ' ; '.(microtime() - $QueryStartTime). ' s';
     71    if($this->LogSQLQuery == true)
     72      file_put_contents($this->LogFile, $Query.$Duration."\n", FILE_APPEND);
    7173    if($this->ShowSQLQuery == true)
    72     {
    73         $Duration = ' ; '.(microtime() - $QueryStartTime). ' s';
    7474      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");
    75     }
    7675    if($Result->PDOStatement)
    7776    {
  • trunk/includes/Version.php

    r768 r769  
    66// and system will need database update.
    77
    8 $Revision = 769; // Subversion revision
     8$Revision = 770; // Subversion revision
    99$DatabaseRevision = 748; // Database structure revision
    10 $ReleaseTime = '2014-01-27';
     10$ReleaseTime = '2014-01-30';
Note: See TracChangeset for help on using the changeset viewer.