2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 11/16/2003 *
4 * =================== Last change: 12/13/2004 *
6 * -------------------------------------------------------------------- *
7 * File : mysql-connect.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Connects to your database *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Verbindet zu Ihrer Datenbank *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
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 *
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. *
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. *
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, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // Init include file array as it follows same naming scheme
58 'extensions') as $lib) {
59 // Load special functions
60 loadIncludeOnce('inc/' . $lib . '-functions.php');
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');
70 set_error_handler('__errorHandler');
72 // Disable block-mode by default
73 enableBlockMode(FALSE);
84 // Set important header_sent
85 if (!isset($GLOBALS['__header_sent'])) {
86 $GLOBALS['__header_sent'] = '0';
89 // Init fatal messages
92 // Init repository data sub-system
95 // Enable HTML templates by default
98 // Are we in installation phase?
99 if ((!isInstalling()) && (!isInstallationPhase())) {
100 // Load configuration file(s) here
101 loadIncludeOnce('inc/load_config.php');
103 // Load database layer here
104 loadIncludeOnce('inc/db/lib.php');
106 // Init message system
110 initExtensionCssFiles();
112 // Initialize SQL link
115 // Default output is 'direct' for HTML output
116 setConfigEntry('OUTPUT_MODE', 'direct');
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');
124 // CFG: DATABASE-TYPE
125 setConfigEntry('_DB_TYPE', 'mysql3');
127 // Load database layer here
128 loadIncludeOnce('inc/db/lib.php');
130 // Init message system
134 foreach (array('databases', 'session', 'versions', 'install-functions', 'load_config', 'load_cache') as $inc) {
136 loadIncludeOnce('inc/' . $inc . '.php');
142 // Check whether we are in installation routine
143 if ((!isInstalling()) && (!isCssOutputMode()) && (!isRawOutputMode())) {
144 // Redirect to the URL
145 redirectToUrl('install.php');
149 // Handle fatal errors
150 runFilterChain('handle_fatal_errors');