\Profiler

Profiler Class

For all your profiling needs

Add a bar on top with profiling data

Not meant to be used in production

Summary

Methods
Properties
Constants
__construct()
autoload()
assert()
setAssertFatal()
display()
gatherAll()
getMicrotime()
getReadableTime()
getReadableFileSize()
$css
No constants found
No protected methods found
No protected properties found
N/A
gatherInputGet()
gatherInputPost()
gatherInputSession()
gatherInputCookie()
gatherFiles()
return_bytes()
$assert
$included_files
$get
$post
$session
$cookie
$autoload
$start_time
$end_time
N/A

Properties

$css

$css : 

CSS that holds the toolbar together

Type

$assert

$assert : 

Type

$included_files

$included_files : 

Type

$get

$get : 

Type

$post

$post : 

Type

$session

$session : 

Type

$cookie

$cookie : 

Type

$autoload

$autoload : 

Type

$start_time

$start_time : 

Type

$end_time

$end_time : 

Type

Methods

__construct()

__construct() 

Constructor

This constructor use:

  • assert_options
  • register_shutdown_function
  • spl_autoload_register

autoload()

autoload(  $class) 

Callback for autoload system

Never call this function directly

Parameters

$class

assert()

assert(string  $file,   $line,   $code,   $desc = null) 

Callback for assert system

Never call this function directly

Just use assert(true==false, 'I want to know if right is wrong');

Parameters

string $file
$line
$code
$desc

setAssertFatal()

setAssertFatal(boolean  $fatal = false) 

Force assert fail to be fatal

Parameters

boolean $fatal

if true, assert fail becomes fatal

display()

display() 

Display the HTML

gatherAll()

gatherAll() 

Gather Data

getMicrotime()

getMicrotime(boolean  $at_start = false) : float

Get microtime.

Parameters

boolean $at_start

set to true if this microtime is get at the very beginning of the app. this can allow newer php version to use $_SERVER['REQUEST_TIME_FLOAT'];

Returns

float —

microtime in float.

getReadableTime()

getReadableTime(integer  $time) : string

Get readable time.

Parameters

integer $time

Returns

string

getReadableFileSize()

getReadableFileSize(integer  $size, string  $retstring = null) : string

Get readable file size.

Parameters

integer $size
string $retstring

Returns

string

gatherInputGet()

gatherInputGet() 

Gather GET

gatherInputPost()

gatherInputPost() 

Gather POST

gatherInputSession()

gatherInputSession() 

Gather SESSION

gatherInputCookie()

gatherInputCookie() 

Gather COOKIE

gatherFiles()

gatherFiles() 

Gather Included Files

return_bytes()

return_bytes(  $size_str) : \Max

Return Bytes from format "128Mo"

Parameters

$size_str

Returns

\Max —

RAM Size