]> git.mxchange.org Git - mailer.git/blob - inc/mysql-connect.php
This 'return FALSE' caused that the PHP's error handler was called :( So, do NEVER...
[mailer.git] / inc / mysql-connect.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 11/16/2003 *
4  * ===================                          Last change: 12/13/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : mysql-connect.php                                *
8  * -------------------------------------------------------------------- *
9  * Short description : Connects to your database                        *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Verbindet zu Ihrer Datenbank                     *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // Init include file array as it follows same naming scheme
44 foreach ( array(
45                 'stats',
46                 'xml',
47                 'callback',
48                 'referral',
49                 'email',
50                 'request',
51                 'session',
52                 'code',
53                 'language',
54                 'sql',
55                 'expression',
56                 'filter',
57                 'revision',
58                 'extensions') as $lib) {
59         // Load special functions
60         loadIncludeOnce('inc/' . $lib . '-functions.php');
61 } // END - foreach
62
63 // Load more function libraries or includes
64 foreach (array('filters', 'mysql-manager', 'handler') as $lib) {
65         // Load special functions
66         loadIncludeOnce('inc/' . $lib . '.php');
67 } // END - foreach
68
69 // Set error handler
70 set_error_handler('__errorHandler');
71
72 // Disable block-mode by default
73 enableBlockMode(FALSE);
74
75 // Init error handler
76 initErrorHandler();
77
78 // Init request
79 initRequest();
80
81 // Init userid
82 initMemberId();
83
84 // Set important header_sent
85 if (!isset($GLOBALS['__header_sent'])) {
86         $GLOBALS['__header_sent'] = '0';
87 } // END - if
88
89 // Init fatal messages
90 initFatalMessages();
91
92 // Init repository data sub-system
93 initRepositoryData();
94
95 // Enable HTML templates by default
96 enableTemplateHtml();
97
98 // Are we in installation phase?
99 if ((!isInstalling()) && (!isInstallationPhase())) {
100         // Load configuration file(s) here
101         loadIncludeOnce('inc/load_config.php');
102
103         // Load database layer here
104         loadIncludeOnce('inc/db/lib.php');
105
106         // Init message system
107         initMessages();
108
109         // CSS array
110         initExtensionCssFiles();
111
112         // Initialize SQL link
113         initSqlLink();
114 } else {
115         // Default output is 'direct' for HTML output
116         setConfigEntry('OUTPUT_MODE', 'direct');
117
118         // This hack prevents a backtrace in CSS output
119         if (isCssOutputMode()) {
120                 // Problem with config so set output mode
121                 setConfigEntry('OUTPUT_MODE', 'render');
122         } // END - if
123
124         // CFG: DATABASE-TYPE
125         setConfigEntry('_DB_TYPE', 'mysql3');
126
127         // Load database layer here
128         loadIncludeOnce('inc/db/lib.php');
129
130         // Init message system
131         initMessages();
132
133         // Include more
134         foreach (array('databases', 'session', 'versions', 'install-functions', 'load_config', 'load_cache') as $inc) {
135                 // Load the include
136                 loadIncludeOnce('inc/' . $inc . '.php');
137         } // END - foreach
138
139         // Init installer
140         initInstaller();
141
142         // Check whether we are in installation routine
143         if ((!isInstalling()) && (!isCssOutputMode()) && (!isRawOutputMode())) {
144                 // Redirect to the URL
145                 redirectToUrl('install.php');
146         } // END - if
147 }
148
149 // Handle fatal errors
150 runFilterChain('handle_fatal_errors');
151
152 // [EOF]
153 ?>