Renamed function so it might be more understandable
[mailer.git] / inc / config-global.php
index a0a80c4478f692150e82d55b44bafe4460b71e19..08efc24050ede7470e8ebea99d3fe578de8fc872 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 04/03/2009 *
- * ===============                              Last change: 04/03/2009 *
+ * Mailer v0.2.1-FINAL                                Start: 04/03/2009 *
+ * ===================                          Last change: 04/03/2009 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : config-global.php                                *
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
-       require($INC);
+       die();
 } // END - if
 
 /************************************************************************
  *      PLEASE DO NOT EDIT THE COMMENTS! install.php NEEDS THEM!        *
  ************************************************************************/
 
+// Proper function exists?
 if (function_exists('date_default_timezone_set')) {
-       // CFG: TIME-ZONE
+       // Set default timezone to Europe/Berlin (because I'm from Germany)
        @date_default_timezone_set('Europe/Berlin');
 } // END - if
 
 // CFG: ERROR_REPORTING
-@error_reporting(0);
+error_reporting(E_ALL | E_STRICT);
 
 // CFG: REGISTER-GLOBALS
 @import_request_variables('');
 
-// @TODO These constants should be rewritten
-define('VERSION', 'v0.2.1');
-define('AUTHOR' , 'Roland H&auml;der');
-define('TITLE', 'MXChange - Mail Exchange');
-define('COPY', 'Copyright &copy; 2003 - 2008, by Roland H&auml;der');
+// Detect path
+$PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
+
+// Some very important function includes
+foreach (array('config','wrapper','template','module','inc','stats') as $inc) {
+       include($PATH . 'inc/' . $inc . '-functions.php');
+} // END - foreach
+
+// Own functions
+include($PATH . 'inc/functions.php');
 
 // Auto-detection... (patched by "Stelzi" aka. profi-concept, thanks again!)
-$URL = 'http://' . getenv('SERVER_NAME') . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
+$URL = 'http://' . detectServerName() . str_replace("\\", '/', dirname($_SERVER['PHP_SELF']));
 while (substr($URL, -1, 1) == '/') { $URL = substr($URL, 0, -1); }
-$PATH = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
 
-// CFG: SERVER-PATH
-define('PATH', $PATH);
+// Initialize the configuration
+initConfig();
 
 // CFG: HOST-URL (without trailing '/' !)
-define('URL', $URL);
+setConfigEntry('URL', $URL);
+
+// CFG: SERVER-PATH
+setConfigEntry('PATH', $PATH);
+
+// CFG: VERSION
+setConfigEntry('VERSION', 'v0.2.1');
+
+// CFG: AUTHOR
+setConfigEntry('AUTHOR' , 'Roland H&auml;der');
+
+// CFG: TITLE
+setConfigEntry('TITLE', 'Mailer Project');
+
+// CFG: COPY
+setConfigEntry('COPY', 'Copyright &copy; 2003 - 2009, by Roland H&auml;der,<br />2009, 2010 by Mailer Developer Team');
+
+// CFG: CACHE-PATH
+setConfigEntry('CACHE_PATH', getConfig('PATH') . 'inc/cache/');
+
+// CFG: STATS-ENABLED (This setting is overwritten by ext-other; at least version 0.2.6)
+setConfigEntry('stats_enabled', 'N');
+
+// GLOBAL: DEBUG-TEMPLATE-CACHE
+setConfigEntry('DEBUG_TEMPLATE_CACHE', 'N');
 
 // Connect to the MySQL database...
-require(constant('PATH') . 'inc/mysql-connect.php');
+loadIncludeOnce('inc/mysql-connect.php');
+
+// Init stats system
+initStatsSystem();
 
-//
+// [EOF]
 ?>