First batch of removal of the headers needed for revision-functions.php
[mailer.git] / debug.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 10/12/2008 *
4  * ===================                          Last change: 23/12/2008 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : debug.php                                        *
8  * -------------------------------------------------------------------- *
9  * Short description : Receiver script for debug.log files              *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Empfangsscript fuer debug.log Dateien            *
12  * -------------------------------------------------------------------- *
13  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
14  * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
15  * For more information visit: http://mxchange.org                      *
16  *                                                                      *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or    *
20  * (at your option) any later version.                                  *
21  *                                                                      *
22  * This program is distributed in the hope that it will be useful,      *
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
25  * GNU General Public License for more details.                         *
26  *                                                                      *
27  * You should have received a copy of the GNU General Public License    *
28  * along with this program; if not, write to the Free Software          *
29  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
30  * MA  02110-1301  USA                                                  *
31  ************************************************************************/
32
33 // Load security stuff here
34 require('inc/libs/security_functions.php');
35
36 // Init start time
37 $GLOBALS['__start_time'] = microtime(TRUE);
38
39 // Set module and fake "CSS mode"
40 $GLOBALS['__module']      = 'debug';
41 $GLOBALS['__output_mode'] = -1;
42
43 // Load the required file(s)
44 require('inc/config-global.php');
45
46 // Redirect only to registration page when this script is installed
47 if ((isExtensionActive('debug')) && (!ifFatalErrorsDetected())) {
48         // Is the request parameter set?
49         if (isPostRequestElementSet('request')) {
50                 // Handle the request
51                 if (DEBUG_HANDLE_REQUEST(postRequestElement('request'))) {
52                         // Construct FQFN for the module
53                         $inc = sprintf('inc/debug/%s/request_%s.php',
54                                 getConfig('debug_mode'),
55                                 sqlEscapeString(postRequestElement('request'))
56                         );
57
58                         // Is the module there? Else we log it!
59                         if (isIncludeReadable($inc)) {
60                                 // Load the requested module
61                                 loadInclude($inc);
62                         } else {
63                                 // Missing request files may happen while development
64                                 DEBUG_ABUSE_LOG(__FILE__, __LINE__, 'request_404', postRequestElement('request'));
65                         }
66                 } else {
67                         // Unhandled request detected
68                         DEBUG_ABUSE_LOG(__FILE__, __LINE__, 'request_unhandled', postRequestElement('request'));
69                 }
70         } else {
71                 // Empty request
72                 DEBUG_ABUSE_LOG(__FILE__, __LINE__, 'request_empty', '');
73         }
74 } else {
75         // Not installed or fatal errors
76         DEBUG_ABUSE_LOG(__FILE__, __LINE__, 'request_fatal', getTotalFatalErrors());
77 } // END - if
78
79 // Really all done here... ;-)
80 doShutdown();
81
82 // [EOF]
83 ?>