phpquickprofiler Php Quick Profiler Wrapper

  1. Requirements
  2. Usage
  3. Resources Php Quick Profiler Wrapper

Its a Web Log Router that will help you profile your application, its database profiling feature allows you to quickly find duplicated queries, see which queries are taking too long, the memory tab allows you to find memory leaks, and it also looks beautiful!


Developed using Yii Framework 1.1.8 but it may work with other versions.


  • Download and extract the contents of the zip to your extensions folder
  • Configure the LogRoute in your application configuration
					'levels'=>'error, warning',
					'class' => 'application.extensions.pqp.PQPLogRoute',
					'categories' => 'application.*, exception.*',

Note: if you plan to use phpunit and for some reason you are using a config file that includes PQP you'll get errors about assets folder, to solve this you can set up you log route in the following way as suggested by thefsb

			'routes' => array_merge(
				'levels'=>'error, warning, info',
		array(php_sapi_name() !== 'cli'
			? array(
				'class' => 'application.extensions.pqp.PQPLogRoute',
				'categories' => 'application.*, exception.*, system.*',
				'levels'=>'error, warning, info',
			: array('class'=>'CWebLogRoute', 'enabled'=>false)
  • Enable Database Profiling and param loggin:
			'connectionString' => '...',
			'enableProfiling' => true,
			'enableParamLogging' => true,
  • Log as you normaly would with Yii using Yii::trace, Yii::log, Yii::beginProfile and Yii::endProfile, use PQPLogRoute::logMemory to log memory, you can use it to log objects to know its memory consumption, if you pass a string it will tell you know much memory has been used to that point.
	 * Logs a memory message.
	 * @param mixed $obj any type of variable to profile memory
	 * @param string $msg message to be logged
	 * @param string  $category category of the message (e.g. 'system.web'). It is case-insensitive.
	public static function logMemory($obj, $msg = '', $category='application'){
PQPLogRoute::logMemory("memory used after action call");
try {
	Yii::beginProfile('Execution time');
	Yii::log('Begin logging data');
	PQPLogRoute::logMemory($this, "the site controller");
	$arr = array('Name' => 'Ryan', 'Last' => 'Campbell');
	PQPLogRoute::logMemory($arr, "Normal array");
	$users = User::model()->findAll();
	PQPLogRoute::logMemory($users, "Users array");
	Yii::endProfile('Execution time');
	throw new Exception('Unable to write to log!');
catch(Exception $e) {
	Yii::log($e, CLogger::LEVEL_ERROR);
PQPLogRoute::logMemory("memory used before render");


  • Project page
  • Demo: in the downloads
  • Forum Post your questions there, avoid posting questions in the extension page.
  • Screenshots : Console Speed Database Memory Files
29 0
2 106 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Logging
Developed by: Asgaroth
Created on: Nov 21, 2011
Last updated: 12 years ago


show all

Related Extensions