PHP - What is auto_prepend_file
Automatically add files before or after any PHP document. Put into your php.ini file:
auto_prepend_file =/tmp/php_auto_prepend_file.php
An associate setting in php.ini:
auto_append_file =/tmp/php_auto_append_file.php
These are handy if you want to run some code before and after all PHP scripts. For example, the content of /tmp/php_auto_prepend_file.php might be:
function log_memory_usage() { if (function_exists('memory_get_usage')) { $memory_usage = memory_get_usage(true); if (function_exists('apache_note')) { apache_note('memory_usage',$memory_usage); } } } register_shutdown_function('log_memory_usage');
Perhaps, I can also use this to measure how long each script execute, and compare this value with what apache provide (See apache module mod_log_config)
page revision: 0, last edited: 29 Apr 2010 07:36





