Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@planway:/var/www/demo.planway.com/htdocs# cat shutdown_handler.php
- <?php
- $timer = time();
- function writelog($str)
- {
- $fh = fopen("/var/www/demo.planway.com/htdocs/logfile.log","a");
- fputs($fh, $str."\n");
- fclose($fh);
- }
- function shutdown()
- {
- global $timer;
- $etime = (time() - $timer);
- print "Execution took $etime<br>";
- if ($etime > 4)
- {
- writelog(" ---- Request took $etime\n".print_r($_SERVER,true));
- }
- echo 'Script executed with success', PHP_EOL;
- }
- regis
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement