16 ### DEBUGGER & LOGGER COMPONENT HELPERS #############################
24 function ptc_log( $string , $statement = null , $category = null )
26 return ptc_run(
'bufferLog' , @_PTCDEBUG_NAMESPACE_ , array( $string , $statement , $category ) );
34 function ptc_log_sql( $string , $statement = null , $category = null )
36 return ptc_run(
'bufferSql' , @_PTCDEBUG_NAMESPACE_ , array( $string , $statement , $category ) );
45 return ptc_run(
'stopTimer' , @_PTCDEBUG_NAMESPACE_ , array( $reference , $precision ) );
53 function ptc_attach( $reference , $string , $statement = null )
55 return ptc_run(
'addToBuffer' , @_PTCDEBUG_NAMESPACE_ , array( $reference , $string , $statement ) );
62 function ptc_watch( $variableName , $callback = null )
64 return ptc_run(
'watch' , @_PTCDEBUG_NAMESPACE_ , array( $variableName , $callback ) );
84 ### HANDYMAN COMPONENT HELPERS ###############################
92 $handyman =
'_PTCHANDYMAN_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
93 return ptc_run(
'getAppPaths' , @constant( $handyman ) , array( $type ) );
101 $handyman =
'_PTCHANDYMAN_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
102 return ptc_run(
'addAppPath' , @constant( $handyman ) , array( $paths ) );
110 $handyman =
'_PTCHANDYMAN_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
111 return ptc_run(
'getDirs' , @constant( $handyman ) , array( $type ) );
119 $handyman =
'_PTCHANDYMAN_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
120 return ptc_run(
'addDirs' , @constant( $handyman ) , array( $directories ) );
128 $handyman =
'_PTCHANDYMAN_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
129 return ptc_run(
'addFiles' , @constant( $handyman ) , array( $files ) );
138 $handyman =
'_PTCHANDYMAN_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
139 return ptc_run(
'getProperty' , @constant( $handyman ) , array( $class , $propertyName ) );
142 ### EVENT DISPATCHER COMPONENT HELPERS ##################################
152 $ptc_event =
'_PTCEVENT_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
153 return ptc_run(
'listen' , @constant( $ptc_event ) , array( $event , $callback , $priority ) );
162 $ptc_event =
'_PTCEVENT_' . @strtoupper( @str_replace(
'\\' ,
'_' , __NAMESPACE__ ) ) .
'_';
163 return ptc_run(
'fire' , @constant( $ptc_event ) , array( $event , $data ) );
166 ### PHPTOOLCASE RUNNER UTILITY #############################
175 function ptc_run( $function , $class = null , $args = array( ) )
177 $call = ( $class ) ? array(
'\\' . $class , $function ) : $function;
178 if ( @is_callable( $call ) ) {
return call_user_func_array( $call , $args ); }
ptc_path($type=null)
Retrieves the application paths stored in the PtcHandyMan::$_appPaths array.
ptc_stop_timer($reference=null, $precision=1)
Monitors the execution of php code, or sql queries based on a reference.
ptc_add_dir($directories)
Adds directories to the autoloader to load classes.
ptc_add_file($files)
Adds files to the class autoloader.
ptc_run($function, $class=null, $args=array())
Runs class methods.
ptc_log_sql($string, $statement=null, $category=null)
Writes data to the sql panel.
ptc_listen($event, $callback, $priority=0)
Adds a listener to an event.
ptc_start_trace()
Starts the function calls trace utility.
ptc_attach($reference, $string, $statement=null)
Attaches data to the buffer array based on a reference.
ptc_stop_coverage()
Stop the code coverage analysis utility.
ptc_dir($type=null)
Retrieves the directories the autoloader uses to load classes.
ptc_fire($event, $data)
Fires an event See PtcEvent::fire( )
ptc_start_coverage()
Starts the code coverage analysis utility to find executed lines.
ptc_get_prop($class, $propertyName)
Gets protected and private properties.
ptc_stop_trace()
Stop the function calls trace utility.
ptc_log($string, $statement=null, $category=null)
Writes data to the messages panel.
ptc_add_path($paths)
Adds application paths to the PtcHandyMan::$_appPaths array.
ptc_watch($variableName, $callback=null)
Watches a variable that is in a declare(ticks=n){ code block }, for changes.