Changeset 542


Ignore:
Timestamp:
Jun 17, 2013, 10:42:13 AM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Možnost zaznamenávat všechny SQL povely do souboru.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/DefaultConfig.php

    r535 r542  
    2424    'ShowSQLQuery' => false,
    2525    'ShowSQLError' => $IsDeveloper,
    26     'ShowPHPError' => $IsDeveloper,
    27     'ShowRuntimeInfo' => $IsDeveloper,
     26    'LogSQLQuery' => $IsDeveloper,
     27        'ShowPHPError' => $IsDeveloper,
     28        'ShowRuntimeInfo' => $IsDeveloper,
    2829    'FormatOutput' => $IsDeveloper,
    2930        'ItemsPerPage' => 40,
  • trunk/includes/Database.php

    r540 r542  
    2828class Database
    2929{
    30   var $Prefix = '';
    31   var $Functions = array('NOW()', 'CURDATE()', 'CURTIME()', 'UUID()');
    32   var $Type = 'mysql';  // mysql, pgsql
     30  var $Prefix;
     31  var $Functions;
     32  var $Type
    3333  var $PDO;
    34   var $Error = '';
     34  var $Error;
    3535  var $insert_id;
    36   var $LastQuery = '';
    37   var $ShowSQLError = false;
    38   var $ShowSQLQuery = false;
     36  var $LastQuery;
     37  var $ShowSQLError;
     38  var $ShowSQLQuery;
     39  var $LogFile;
    3940 
    4041  function __construct()
    4142  {   
     43        $this->Functions = array('NOW()', 'CURDATE()', 'CURTIME()', 'UUID()');
     44        $this->Type = 'mysql'; // mysql, pgsql
     45        $this->ShowSQLError = false;
     46        $this->ShowSQLQuery = false;
     47        $this->LogSQLQuery = false;
     48        $this->LogFile = 'Query.log';
    4249  }
    4350 
     
    6067    if($this->ShowSQLQuery == true)
    6168      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");
     69    if($this->LogSQLQuery == true)
     70      file_put_contents($this->LogFile, $Query."\n", FILE_APPEND);
    6271    $Result = new DatabaseResult();
    6372    $Result->PDOStatement = $this->PDO->query($Query);
  • trunk/includes/Page.php

    r539 r542  
    234234
    235235  $Output = '<strong>Překladové skupiny:</strong><br /><div id="TranslationMenu">';
    236   $DbResult = $System->Database->select('Group', 'Id, Name', '1 ORDER BY Name');
     236  $DbResult = $System->Database->select('Group', '`Id`, `Name`', '1 ORDER BY `Name`');
    237237  while($Group = $DbResult->fetch_assoc())
    238238  {
  • trunk/includes/Version.php

    r541 r542  
    11<?php
    22
    3 $Revision = 541; // Subversion revision
     3$Revision = 542; // Subversion revision
    44$DatabaseRevision = 539; // Database structure revision
    5 $ReleaseTime = '2013-05-27';
     5$ReleaseTime = '2013-06-17';
    66
    77?>
  • trunk/includes/system.php

    r538 r542  
    3939    $this->Database->ShowSQLQuery = $this->Config['Web']['ShowSQLQuery'];
    4040    $this->Database->ShowSQLError = $this->Config['Web']['ShowSQLError'];
     41    $this->Database->LogSQLQuery = $this->Config['Web']['LogSQLQuery'];
    4142  }
    4243 
Note: See TracChangeset for help on using the changeset viewer.