]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/prepend.php
Refactor/cleanup of login code continues.
[SourceForge/phpwiki.git] / lib / prepend.php
1 <?php
2 /* lib/prepend.php
3  *
4  * Things which must be done and defined before anything else.
5  */
6 $RCS_IDS = '';
7 function rcs_id ($id) { $GLOBALS['RCS_IDS'] .= "$id\n"; }
8 rcs_id('$Id: prepend.php,v 1.10 2002-01-23 05:10:22 dairiki Exp $');
9
10 error_reporting(E_ALL);
11 require_once('lib/ErrorManager.php');
12 require_once('lib/WikiCallback.php');
13
14 // FIXME: deprecated
15 function ExitWiki($errormsg = false)
16 {
17     global $request;
18     static $in_exit = 0;
19
20     if (is_object($request))
21         $request->finish($errormsg); // NORETURN
22
23     if ($in_exit)
24         exit;
25     
26     $in_exit = true;
27
28     global $ErrorManager;
29     $ErrorManager->flushPostponedErrors();
30    
31     if(!empty($errormsg)) {
32         PrintXML(array(HTML::br(), $errormsg));
33         print "\n</body></html>";
34     }
35     exit;
36 }
37
38 $ErrorManager->setPostponedErrorMask(E_ALL);
39 $ErrorManager->setFatalHandler(new WikiFunctionCb('ExitWiki'));
40
41 // (c-file-style: "gnu")
42 // Local Variables:
43 // mode: php
44 // tab-width: 8
45 // c-basic-offset: 4
46 // c-hanging-comment-ender-p: nil
47 // indent-tabs-mode: nil
48 // End:   
49 ?>