Skip to content

Commit

Permalink
Adding before_exit callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Luraine committed Jul 18, 2009
1 parent 4fac3d0 commit 7c3e5f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/limonade.php
Expand Up @@ -147,6 +147,7 @@ function remove_magic_quotes($array)
# function not_found(){}
# function server_error(){}
# function route_missing(){}
# function before_exit(){}


## MAIN PUBLIC FUNCTIONS _______________________________________________________
Expand Down Expand Up @@ -401,6 +402,7 @@ function render_limonade_file()
*/
function stop_and_exit()
{
call_if_exists('before_exit');
flash_sweeper();
if(defined('SID')) session_write_close();
exit;
Expand Down
11 changes: 11 additions & 0 deletions lib/limonade/abstract.php
Expand Up @@ -93,5 +93,16 @@ function route_missing($request_method, $request_uri)
{
halt(NOT_FOUND, "($request_method) $request_uri"); # by default
}

/**
* Called before stoppping and exiting application.
*
* @abstract this function might be redefined by user
* @return void
*/
function before_exit()
{

}

?>

0 comments on commit 7c3e5f0

Please sign in to comment.