Changeset 172 for trunk/lib/DB.inc.php


Ignore:
Timestamp:
Jun 15, 2006 7:59:45 PM (18 years ago)
Author:
scdev
Message:

Q - added caching to ACL, and flush command to acl.cli.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/DB.inc.php

    r156 r172  
    1717    // Database handle.
    1818    var $dbh;
     19   
     20    // Count how many queries run during the whole instance.
     21    var $_query_count = 0;
    1922
    2023    // Hash of DB parameters.
     
    229232    function query($query, $debug=false)
    230233    {   
    231         static $_query_count = 0;
    232234        $app =& App::getInstance();
    233235
     
    236238        }
    237239
    238         $_query_count++;
     240        $this->_query_count++;
     241
    239242        $debugqry = preg_replace("/\n[\t ]+/", "\n", $query);
    240243        if ($this->getParam('db_always_debug') || $debug) {
    241             echo "<!-- ----------------- Query $_query_count ---------------------\n$debugqry\n-->\n";
     244            echo "<!-- ----------------- Query $this->_query_count ---------------------\n$debugqry\n-->\n";
    242245        }
    243246
     
    342345        }
    343346    }
     347   
     348    /*
     349    * Return the total number of queries run this for.
     350    *
     351    * @access   public
     352    * @return   int Number of queries
     353    * @author   Quinn Comendant <quinn@strangecode.com>
     354    * @version  1.0
     355    * @since    15 Jun 2006 11:46:05
     356    */
     357    function numQueries()
     358    {
     359        return $this->_query_count;
     360    }
    344361
    345362    /**
Note: See TracChangeset for help on using the changeset viewer.