Source for file QueryCounter.class.php

Documentation is available at QueryCounter.class.php

  1. <?php
  2.  
  3. /**
  4. * Allows you count the number of DB queries from start() to end().
  5. *
  6. * @package harmoni.utilities
  7. *
  8. * @copyright Copyright &copy; 2005, Middlebury College
  9. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  10. *
  11. * @version $Id: QueryCounter.class.php,v 1.5 2007/09/04 20:25:54 adamfranco Exp $
  12. */
  13. class QueryCounter {
  14. var $_start;
  15. var $_end;
  16. function start() {
  17. $db = Services::getService("DatabaseManager");
  18. $this->_start = $db->getTotalNumberOfQueries();
  19. }
  20. function end() {
  21. $db = Services::getService("DatabaseManager");
  22. $this->_end = $db->getTotalNumberOfQueries();
  23. }
  24. function count() {
  25. return ($this->_end-$this->_start);
  26. }
  27. }
  28.  
  29. ?>

Documentation generated on Wed, 19 Sep 2007 10:25:45 -0400 by phpDocumentor 1.3.0RC3