Execution InformationPodręcznik PHPPoprzedniRozdział 36. Printing InformationNastępnyExecution Information
You can also print execution information, such as the current file
being executed. The name of the function currently being executed
can be retrieved using the function
get_active_function_name(). This function
returns a pointer to the function name and doesn't accept any
arguments. To retrieve the name of the file currently being
executed, use zend_get_executed_filename().
This function accesses the executor globals, which are passed to
it using the TSRMLS_C macro. The executor globals
are automatically available to every function that's called
directly by Zend (they're part of the
INTERNAL_FUNCTION_PARAMETERS described earlier
in this chapter). If you want to access the executor globals in
another function that doesn't have them available automatically,
call the macro TSRMLS_FETCH() once in that
function; this will introduce them to your local scope.
Finally, the line number currently being executed can be retrieved
using the function zend_get_executed_lineno().
This function also requires the executor globals as arguments. For
examples of these functions, see Przykład 36-2.
Przykład 36-2. Printing execution information.zend_printf("The name of the current function is %s<br>", get_active_function_name(TSRMLS_C));
zend_printf("The file currently executed is %s<br>", zend_get_executed_filename(TSRMLS_C));
zend_printf("The current line being executed is %i<br>", zend_get_executed_lineno(TSRMLS_C));PoprzedniSpis treściNastępnyIncluding Output in phpinfo()Początek rozdziałuStartup and Shutdown Functions
Wyszukiwarka
Podobne podstrony:
zend printingzend printingzend printing zend errorfunction pdf execute imageprinting howto pl 5printing softwareprinting howto pl 4function zend versionExecutorzend arguments variableprinting howto pl 6function zend logo guidprinting howto 3 obrkqk3bd7gpi3ys7thklyi4c5ur6u3csqt2vvywięcej podobnych podstron