BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/lang/Bs_XRay.class.php
BlueShoes Application Framework - lang

Bs_XRay

Bs_XRay

*********************************************************************

 

private class Bs_XRay

*********************************************************************
XRay collection of debugging stuff.Note: It's truly STATIC (no 'this')The Problem (to solve):-----------------------While a silple PHP echo or var_dump() are simple function to use to dosome simple debugging, there is a major drawback:You CAN'T use them in a *life* system. All the useres would see theoutput too.So how can you output info, that is only intended for the developer?The Solution:-------------Set a flag if request comes for a defined (developer) IP.Trace- and Debbug- function output only if request come for that given IP.Usage:------Per default all XR-function will react if the requst IP is 'localhost'To set the IP(s) call: Bs_XRay::activateOnIP($IPs);Depending on the callers IP, the GLOBAL flag: $XR_isOnis set to TRUE or FALSE. For performance reasons it's allowed to usethe flag directy OR call XR_isOn() (2ed option costs a little more CPU, I think).E.g. :if ($GLOBALS['XR_isOn']) { / * trace something * / }ORif (XR_isOn()) { / * trace something * / }NOTE:-----1) For comfort some short hand function have been defined that base on theXRay-Class.XR_isOn();XR_echo ($msg, $_line_='', $_func_='', $_file_=''); // Use instead of PHP's echoXR_echoPre ($msg, $_line_='', $_func_='', $_file_=''); // Use instead of PHP's echoXR_dump ($foo, $_line_='', $_func_='', $_file_=''); // Use instead of PHP's var_dump() of print_r()2) The Class used is *turly static*. That means no 'this' is used.

Authors
Copyrightblueshoes.org

 

Private Method Summary

void

XR_isOn()

For comfort some short hand function have been defined that base on the XRay-Class.
void

activateOnIP([ mixed $IPs ])

Define the IP (or IP's) that will activate XRay. That is set $XR_isOn to TRUE.
void

echoHtml( $msg, string $_line_, string $_func_, string $_file_)

Use instead of PHP's echo
void

echoPre( $msg, string $_line_, string $_func_, string $_file_)

Use instead of PHP's echo. (Puts output in a <pre>-tag)
void

dump( $msg, string $_line_, string $_func_, string $_file_)

Use instead of PHP's var_dump() or print_r()
void

_msgInfoLine( $_line_, $_func_, $_file_)

Render the msg line
void

XR_echo( $msg, string $_line_, string $_func_, string $_file_)

Warning: documentation is missing.
void

XR_echoPre( $msg, string $_line_, string $_func_, string $_file_)

Warning: documentation is missing.
void

XR_dump( $foo, string $_line_, string $_func_, string $_file_)

Warning: documentation is missing.
void

funcStart(string $_line_, string $_func_, string $_file_, $comment)

Warning: documentation is missing.
void

funcEnd(string $_line_, string $_func_, string $_file_, $comment)

Warning: documentation is missing.

Private Method Details

XR_isOn

private void XR_isOn( )

  For comfort some short hand function have been defined that base on the XRay-Class.
Instead of calling the XRay::dump() you can use XR_dump()XR_isOn();XR_echo ($msg, $_line_='', $_func_='', $_file_=''); // Use instead of PHP's echoXR_echoPre ($msg, $_line_='', $_func_='', $_file_=''); // Use instead of PHP's echoXR_dump ($foo, $_line_='', $_func_='', $_file_=''); // Use instead of PHP's var_dump() of print_r()

Returns void


activateOnIP

private void activateOnIP( [ mixed $IPs ] )

  Define the IP (or IP's) that will activate XRay. That is set $XR_isOn to TRUE.
The param can be an IP-string eg: '12.122.232.2' or array of IP-stringsIP's can have '*' as wildcard. Froms like '12.2.' have the same meaning as '12.2.*.*'NOTE: If XRay is on, then PHP error reporting is set to E_ALL too.

Parameter
mixed $IPs = >>array()<<
or string (see text above)
Returns void


echoHtml

private void echoHtml( $msg, string $_line_, string $_func_, string $_file_ )

  Use instead of PHP's echo

Parameter
$msg
Warning: documentation is missing.
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
Returns void


echoPre

private void echoPre( $msg, string $_line_, string $_func_, string $_file_ )

  Use instead of PHP's echo. (Puts output in a <pre>-tag)

Parameter
$msg
Warning: documentation is missing.
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
Returns void


dump

private void dump( $msg, string $_line_, string $_func_, string $_file_ )

  Use instead of PHP's var_dump() or print_r()

Parameter
$msg
Warning: documentation is missing.
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
Returns void


_msgInfoLine

private void _msgInfoLine( $_line_, $_func_, $_file_ )

  Render the msg line

Parameter
$_line_
Warning: documentation is missing.
$_func_
Warning: documentation is missing.
$_file_
Warning: documentation is missing.
Returns void


XR_echo

private void XR_echo( $msg, string $_line_, string $_func_, string $_file_ )

 

Warning: documentation is missing.

Parameter
$msg
Warning: documentation is missing.
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
Returns void


XR_echoPre

private void XR_echoPre( $msg, string $_line_, string $_func_, string $_file_ )

 

Warning: documentation is missing.

Parameter
$msg
Warning: documentation is missing.
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
Returns void


XR_dump

private void XR_dump( $foo, string $_line_, string $_func_, string $_file_ )

 

Warning: documentation is missing.

Parameter
$foo
Warning: documentation is missing.
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
Returns void


funcStart

private void funcStart( string $_line_, string $_func_, string $_file_, $comment )

 

Warning: documentation is missing.

Parameter
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
$comment
Warning: documentation is missing.
Returns void


funcEnd

private void funcEnd( string $_line_, string $_func_, string $_file_, $comment )

 

Warning: documentation is missing.

Parameter
string $_line_
Warning: documentation is missing.
string $_func_
Warning: documentation is missing.
string $_file_
Warning: documentation is missing.
$comment
Warning: documentation is missing.
Returns void



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta