Class Profiler

Description

Profiler Class

The Profiler class is statically interfaced with and allows for in depth profiling of a site. By default profiling is off, but can be enabled in the config.ini for a site. Out of the box the profiler will report on every class object in the system that extends the code Object class.

Note: I really wanted to use PHP Quick Profiler by Ryan Campbell of Particletree but it kept barking out errors when I tried to use it with E_STRICT turned on. Here's a link anyway since it looks awesome: http://particletree.com/features/php-quick-profiler/

Located in /classes/Profiler.php (line 34)


	
			
Method Summary
static boolean enabled (array $type)
static void log (mixed $data, [string $method = false], [ $type = false])
static void logQuery (string $query, [array $input_parameters = false], [array $explain = false], [float $duration = false])
static void report ()
static boolean timer (string $timer)
Methods
static method enabled (line 101)

Enabled

Checks if the profiler is set to boolean true or if the passed type is specified in the profiler configuration value.

  • return: whether or not the type is enabled
  • access: public
static boolean enabled (array $type)
  • array $type: type(s) to check
static method log (line 144)

Log

Logs the event to be displayed later on. Due to the nature of how much of a pain it is to determine which class method called this method I opted to make the method a passable argument for ease of use. Perhaps I'll revisit in the future. Handles all elapsed time calculations and memory usage.

  • access: public
static void log (mixed $data, [string $method = false], [ $type = false])
  • mixed $data: data to log
  • string $method: name of the class method being logged
  • $type
static method logQuery (line 201)

Log Query

Serves as a wrapper to get query data to the log function

  • access: public
static void logQuery (string $query, [array $input_parameters = false], [array $explain = false], [float $duration = false])
  • string $query: the query being executed
  • array $input_parameters: optional prepared statement data
  • array $explain: EXPLAIN data for the query
  • float $duration: the speed of the query
static method report (line 279)

Report

Generates the Profiler report that is displayed by the Controller. Contains all the HTML needed to display the data properly inline on the page. Will generally be displayed after the closing HTML tag.

  • access: public
static void report ()
static method timer (line 248)

Timer

Logs the start and end of a timer.

  • return: whether or not timer profiling is enabled
  • access: public
static boolean timer (string $timer)
  • string $timer: name of the timer

Documentation generated on Wed, 03 Oct 2012 17:46:06 -0400 by phpDocumentor 1.4.4