PhpToolCase
Api Documentation Version 0.9.2
ptc-helpers.php File Reference

Prototypes

 ptc_log ($string, $statement=null, $category=null)
 Writes data to the messages panel. More...
 
 ptc_log_sql ($string, $statement=null, $category=null)
 Writes data to the sql panel. More...
 
 ptc_stop_timer ($reference=null, $precision=1)
 Monitors the execution of php code, or sql queries based on a reference. More...
 
 ptc_attach ($reference, $string, $statement=null)
 Attaches data to the buffer array based on a reference. More...
 
 ptc_watch ($variableName, $callback=null)
 Watches a variable that is in a declare(ticks=n){ code block }, for changes. More...
 
 ptc_start_coverage ()
 Starts the code coverage analysis utility to find executed lines. More...
 
 ptc_stop_coverage ()
 Stop the code coverage analysis utility. More...
 
 ptc_start_trace ()
 Starts the function calls trace utility. More...
 
 ptc_stop_trace ()
 Stop the function calls trace utility. More...
 
 ptc_path ($type=null)
 Retrieves the application paths stored in the PtcHandyMan::$_appPaths array. More...
 
 ptc_add_path ($paths)
 Adds application paths to the PtcHandyMan::$_appPaths array. More...
 
 ptc_dir ($type=null)
 Retrieves the directories the autoloader uses to load classes. More...
 
 ptc_add_dir ($directories)
 Adds directories to the autoloader to load classes. More...
 
 ptc_add_file ($files)
 Adds files to the class autoloader. More...
 
 ptc_get_prop ($class, $propertyName)
 Gets protected and private properties. More...
 
 ptc_listen ($event, $callback, $priority=0)
 Adds a listener to an event. More...
 
 ptc_fire ($event, $data)
 Fires an event See PtcEvent::fire( ) More...
 
 ptc_run ($function, $class=null, $args=array())
 Runs class methods. More...
 

Go to the source code of this file.

Function Documentation

ptc_add_dir (   $directories)

Adds directories to the autoloader to load classes.

See PtcHandyMan::addDirs( )

Parameters
array | string$directoriesthe full path to the directories holding the classes

Definition at line 117 of file ptc-helpers.php.

ptc_add_file (   $files)

Adds files to the class autoloader.

See PtcHandyMan::addFiles( )

Parameters
array$filesthe full path to the class file(s)

Definition at line 126 of file ptc-helpers.php.

ptc_add_path (   $paths)

Adds application paths to the PtcHandyMan::$_appPaths array.

See PtcHandyMan::addAppPath( )

Parameters
array  |  string$pathsthe application paths to add

Definition at line 99 of file ptc-helpers.php.

ptc_attach (   $reference,
  $string,
  $statement = null 
)

Attaches data to the buffer array based on a reference.

See PtcDebug::addToBuffer( )

Parameters
string$referencea reference to look for ("$statement")
mixed$stringthe message to show
string$statementa new statement if required

Definition at line 53 of file ptc-helpers.php.

ptc_dir (   $type = null)

Retrieves the directories the autoloader uses to load classes.

See PtcHandyMan::getDirs( )

Parameters
string$typethe directory type

Definition at line 108 of file ptc-helpers.php.

ptc_fire (   $event,
  $data 
)

Fires an event See PtcEvent::fire( )

Parameters
string$eventthe event name to fire
array$dataan array with the data you wish to pass to the listeners

Definition at line 160 of file ptc-helpers.php.

ptc_get_prop (   $class,
  $propertyName 
)

Gets protected and private properties.

See PtcHandyMan::getProperty( )

Parameters
mixed$classthe name or the initialized class object
string$propertyNamethe name of the property

Definition at line 136 of file ptc-helpers.php.

ptc_listen (   $event,
  $callback,
  $priority = 0 
)

Adds a listener to an event.

See PtcEvent::listen( )

Parameters
string$eventthe event name, example: "event.sub_event"
mixed$callbacka valid callback ( closure , function , class )
numeric$prioritya numeric value, higher values will execute first

Definition at line 150 of file ptc-helpers.php.

ptc_log (   $string,
  $statement = null,
  $category = null 
)

Writes data to the messages panel.

See PtcDebug::bufferLog( )

Parameters
mixed$stringthe string to pass
mixed$statementsome statement if required
string$categorya category for the messages panel

Definition at line 24 of file ptc-helpers.php.

ptc_log_sql (   $string,
  $statement = null,
  $category = null 
)

Writes data to the sql panel.

See PtcDebug::bufferSql()

Parameters
mixed$stringthe string to pass
mixed$statementsome statement if required
string$categorya category for the sql panel

Definition at line 34 of file ptc-helpers.php.

ptc_path (   $type = null)

Retrieves the application paths stored in the PtcHandyMan::$_appPaths array.

See PtcHandyMan::getAppPath( )

Parameters
string$typethe path type

Definition at line 90 of file ptc-helpers.php.

ptc_run (   $function,
  $class = null,
  $args = array( ) 
)

Runs class methods.

Parameters
string$functionthe function/method to run
string$classthe class name with it's full namespace
array$argsan array with arguments for the method
Returns
the result of the call, or false if the method was not callable

Definition at line 175 of file ptc-helpers.php.

ptc_start_coverage ( )

Starts the code coverage analysis utility to find executed lines.

See PtcDebug::startCoverage( )

Definition at line 69 of file ptc-helpers.php.

ptc_start_trace ( )

Starts the function calls trace utility.

See PtcDebug::startTrace( )

Definition at line 77 of file ptc-helpers.php.

ptc_stop_coverage ( )

Stop the code coverage analysis utility.

See PtcDebug::stopCoverage( )

Definition at line 73 of file ptc-helpers.php.

ptc_stop_timer (   $reference = null,
  $precision = 1 
)

Monitors the execution of php code, or sql queries based on a reference.

See PtcDebug::stopTimer( )

Parameters
string$referencea reference to look for ("$statement")
string | numeric$precisionsec/ms

Definition at line 43 of file ptc-helpers.php.

ptc_stop_trace ( )

Stop the function calls trace utility.

See PtcDebug::stopTrace( )

Definition at line 81 of file ptc-helpers.php.

ptc_watch (   $variableName,
  $callback = null 
)

Watches a variable that is in a declare(ticks=n){ code block }, for changes.

See PtcDebug::watch( )

Parameters
string$variableNamethe name of the variable to watch
string$callbacka callback to retrieve the variable

Definition at line 62 of file ptc-helpers.php.