Phpfox_Debug

Description

Handles the debugging of the script when in development mode. Mainly used by developers when testing the product itself or their own product.

When testing a part of your code or maybe the entire execution of your code you can add a timer to check how long the code it took to execute the code and how much memory was used. Example:

  1.  Phpfox_Debug::start('my_custom_code');
  2.  // execute all your code here
  3.  Phpfox_Debug::end('my_custom_code');
To retrieve the information run:
  1.  $aData Phpfxo_Debug::getHistory('my_custom_code');
  2.  print_r($aData);

  • author: Raymond Benc
  • version: $Id: debug.class.php 1687 2010-07-22 03:13:27Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/debug/debug.class.php (line 32)


	
			
Variable Summary
 static array $_aDebug
 static array $_aDebugHistory
Method Summary
 static array addRow (bool $html_table, array $row)
 static void end (string $sName, [unknown_type $aExtra = array()], [unknown_type $bBackTrace = false])
 static mixed getDetails ()
 static array getHistory (string $sName)
 static void message (string $sMsg)
 static void reset ([string $sName = null])
 static void start (string $sName)
 static string _addKeyworSyntax (string $sVal)
 static string _getUsableMemory ()
 static string _loadData ( &$mType, mixed $mType)
 static string _parseSQL (string $sStr)
Variables
static array $_aDebug = array() (line 41)

Holds a history of all the debug tests being executed

  • see: self::start()
  • access: public
static array $_aDebugHistory = array() (line 50)

Holds a history of all the completed debug tests that were ran

  • see: self::end()
  • access: public
Methods
static addRow (line 145)

Used to create a table based on content being passed.

  • return: 1st arg. returns if we created a new table and the 2nd arg returns the table HTML content.
  • see: self::getDetails()
  • access: public
array addRow (bool $html_table, array $row)
  • bool $html_table: FALSE will start a new table and TRUE will not create a new table
  • array $row: ARRAY of content to put in the table
static end (line 105)

Ends a debug test and stores it into memory so it can be disabled in our debug table or picked up at a later time for debug purposes.

  • access: public
void end (string $sName, [unknown_type $aExtra = array()], [unknown_type $bBackTrace = false])
  • string $sName: Unique identifier of the test.
  • unknown_type $aExtra: Any extra information you want to pass about the test
  • unknown_type $bBackTrace: Not used at the moment.
static getDetails (line 179)

Debug output found at the bottom of the site when debug mode is enabled.

  • return: Only returns something if the installer is being used and in that case it returns FALSE
  • access: public
mixed getDetails ()
static getHistory (line 131)

Gets history on a specific debug test that was executed earlier

  • return: Returns an ARRAY of the history of the test. If the test was not found it will return an empty ARRAY
  • access: public
array getHistory (string $sName)
  • string $sName: Unique identifier of the test.
static message (line 74)

Store any debug messages that will later be outputed in the global debug table

  • see: self::getDetails()
  • access: public
void message (string $sMsg)
  • string $sMsg: Message you want to save in the debug history
static reset (line 85)

Reset a debug test for a specific routine

  • access: public
void reset ([string $sName = null])
  • string $sName: Unique identifier of the test. If left blank it will reset all tests.
static start (line 58)

Starts a debug test on a specific routine

  • access: public
void start (string $sName)
  • string $sName: Unique identifier of the test
static _addKeyworSyntax (line 434)

We want to identify special SQL functions like ON() or USING()

  • return: Returns updated code with bolding on special functions
  • access: private
string _addKeyworSyntax (string $sVal)
  • string $sVal: SQL Code to parse
static _getUsableMemory (line 451)

Gets the total memory that can be used by the script based on what the server has.

  • return: Total memory allowed by the server
  • access: private
string _getUsableMemory ()
static _loadData (line 403)

Parses ARRAYS and makes it readable for browsers.

  • return: Returns ARRAY as a string that can be outputed to the browser.
  • access: private
  • example: example not found
string _loadData ( &$mType, mixed $mType)
  • mixed $mType: ARRAY we want to display.
  • &$mType
static _parseSQL (line 415)

Parse SQL code so when outputed to the browser it is easier to read and understand.

  • return: Updated SQL code making it easier to read
  • access: private
string _parseSQL (string $sStr)
  • string $sStr: SQL Code to parse

Documentation generated on Tue, 28 Sep 2010 10:36:38 +0200 by phpDocumentor 1.4.0a2