- Timestamp:
- 09/02/08 16:08:00 (3 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
plog-includes/plog-functions.php (modified) (3 diffs)
-
plog-load-config.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plog-includes/plog-functions.php
r574 r576 497 497 function run_query($query) { 498 498 global $PLOGGER_DBH; 499 500 if (defined('PLOGGER_DEBUG') && PLOGGER_DEBUG == '1') { 501 $GLOBALS['query_count']++; 502 $GLOBALS['queries'][] = $query; 503 } 499 504 500 505 $result = @mysql_query($query, $PLOGGER_DBH); … … 1451 1456 } 1452 1457 1458 function plog_timer($time = 'start') { 1459 if (defined('PLOGGER_DEBUG') && PLOGGER_DEBUG == '1') { 1460 global $plog_start_time; 1461 1462 $mtime = microtime(); 1463 $mtime = explode(' ', $mtime); 1464 $mtime = $mtime[1] + $mtime[0]; 1465 if ($time == 'end') { 1466 return 'Page created in ' . ($mtime-$plog_start_time) . ' seconds'; 1467 } else { 1468 return $mtime; 1469 } 1470 } 1471 } 1472 1453 1473 function plogger_init() { 1454 1474 global $config; … … 1929 1949 include($config['basedir'] . 'plog-content/themes/default/footer.php'); 1930 1950 } 1951 if (defined('PLOGGER_DEBUG') && PLOGGER_DEBUG == '1') { 1952 trace('Queries: '.$GLOBALS['query_count']); 1953 foreach ($GLOBALS['queries'] as $q) { 1954 trace($q); 1955 } 1956 trace(plog_timer('end')); 1957 } 1931 1958 } 1932 1959 -
trunk/plog-load-config.php
r575 r576 29 29 } 30 30 require_once(PLOGGER_DIR."plog-includes/plog-functions.php"); 31 32 if (defined('PLOGGER_DEBUG') && PLOGGER_DEBUG == '1') { 33 $GLOBALS['query_count'] = 0; 34 $GLOBALS['queries'] = array(); 35 $plog_start_time = plog_timer(); 36 } 37 31 38 connect_db(); 32 39
