4 * @file classes/core/PKPProfiler.inc.php
6 * Copyright (c) 2000-2009 John Willinsky
7 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
12 * @brief Basic shell class used to wrap the PHP Quick Profiler Class
15 // $Id: PKPProfiler.inc.php,v 1.3 2009/05/05 23:21:04 asmecher Exp $
17 ini_set('include_path', BASE_SYS_DIR
. '/lib/pkp/lib/pqp/classes/' . ENV_SEPARATOR
. ini_get('include_path'));
18 require_once('PhpQuickProfiler.php');
22 /** @var $profiler object instance of the PQP profiler */
28 function PKPProfiler() {
29 $this->profiler
= new PhpQuickProfiler(PhpQuickProfiler
::getMicroTime());
33 * Gather information to be used to display profiling
34 * @return array of stored profiling information
37 $profiler =& $this->profiler
;
38 $profiler->db
= new PKPDBProfiler();
40 $profiler->gatherConsoleData();
41 $profiler->gatherFileData();
42 $profiler->gatherMemoryData();
43 $profiler->gatherQueryData();
44 $profiler->gatherSpeedData();
46 return $profiler->output
;
52 /** @var $queryCount property to wrap DB connection query count */
58 function PKPDBProfiler() {
59 $dbconn =& DBConnection
::getInstance();
61 $this->queryCount
= $dbconn->getNumQueries();
62 $this->queries
=& Registry
::get('queries', true, array());