Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: init.php 4305 2009-01-02 08:05:39Z Tikitiki $
| * $Id: init.php 4864 2010-04-10 09:13:19Z RyanGordon $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 15 | Zeile 15 |
---|
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined."); }
|
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined."); }
|
error_reporting(E_ALL & ~E_NOTICE);
| if(function_exists("unicode_decode")) { // Unicode extension introduced in 6.0 error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE ^ E_STRICT); } elseif(defined("E_DEPRECATED")) { // E_DEPRECATED introduced in 5.3 error_reporting(E_ALL ^ E_DEPRECATED ^ E_NOTICE); } else { error_reporting(E_ALL & ~E_NOTICE); }
|
/* Defines the root directory for MyBB.
|
/* Defines the root directory for MyBB.
|
|
|
Uncomment the below line and set the path manually if you experience problems. Acceptable values are:
|
Uncomment the below line and set the path manually if you experience problems. Acceptable values are:
|
|
|
Always add a trailing slash to the end of the path.
* Path to your copy of MyBB
| Always add a trailing slash to the end of the path.
* Path to your copy of MyBB
|
Zeile 34 | Zeile 47 |
---|
{ define('MYBB_ROOT', dirname(dirname(__FILE__))."/"); }
|
{ define('MYBB_ROOT', dirname(dirname(__FILE__))."/"); }
|
define("TIME_NOW", time());
| define("TIME_NOW", time());
if(function_exists('date_default_timezone_set')) { date_default_timezone_set('GMT'); }
|
require_once MYBB_ROOT."inc/functions_compat.php";
|
require_once MYBB_ROOT."inc/functions_compat.php";
|
|
|
require_once MYBB_ROOT."inc/class_error.php"; $error_handler = new errorHandler();
|
require_once MYBB_ROOT."inc/class_error.php"; $error_handler = new errorHandler();
|
|
|
require_once MYBB_ROOT."inc/functions.php";
require_once MYBB_ROOT."inc/class_timers.php";
| require_once MYBB_ROOT."inc/functions.php";
require_once MYBB_ROOT."inc/class_timers.php";
|
Zeile 49 | Zeile 67 |
---|
require_once MYBB_ROOT."inc/class_core.php"; $mybb = new MyBB;
|
require_once MYBB_ROOT."inc/class_core.php"; $mybb = new MyBB;
|
|
|
if(!file_exists(MYBB_ROOT."inc/config.php")) { $mybb->trigger_generic_error("board_not_installed");
| if(!file_exists(MYBB_ROOT."inc/config.php")) { $mybb->trigger_generic_error("board_not_installed");
|
Zeile 60 | Zeile 78 |
---|
$mybb->config = &$config;
if(!isset($config['database']))
|
$mybb->config = &$config;
if(!isset($config['database']))
|
{
| {
|
$mybb->trigger_generic_error("board_not_installed");
|
$mybb->trigger_generic_error("board_not_installed");
|
}
| }
|
if(!is_array($config['database'])) { $mybb->trigger_generic_error("board_not_upgraded");
| if(!is_array($config['database'])) { $mybb->trigger_generic_error("board_not_upgraded");
|
Zeile 72 | Zeile 90 |
---|
if(empty($config['admin_dir'])) { $config['admin_dir'] = "admin";
|
if(empty($config['admin_dir'])) { $config['admin_dir'] = "admin";
|
}
| }
|
// Trigger an error if the installation directory exists if(is_dir(MYBB_ROOT."install") && !file_exists(MYBB_ROOT."install/lock"))
| // Trigger an error if the installation directory exists if(is_dir(MYBB_ROOT."install") && !file_exists(MYBB_ROOT."install/lock"))
|
Zeile 83 | Zeile 101 |
---|
require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";
switch($config['database']['type'])
|
require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";
switch($config['database']['type'])
|
{
| {
|
case "sqlite3": $db = new DB_SQLite3; break;
| case "sqlite3": $db = new DB_SQLite3; break;
|
Zeile 92 | Zeile 110 |
---|
break; case "pgsql": $db = new DB_PgSQL;
|
break; case "pgsql": $db = new DB_PgSQL;
|
break;
| break;
|
case "mysqli": $db = new DB_MySQLi; break;
| case "mysqli": $db = new DB_MySQLi; break;
|
Zeile 102 | Zeile 120 |
---|
// Check if our DB engine is loaded if(!extension_loaded($db->engine))
|
// Check if our DB engine is loaded if(!extension_loaded($db->engine))
|
{ // Try and manually load it - DIRECTORY_SEPARATOR checks if running windows if(DIRECTORY_SEPARATOR == '\\') { @dl('php_'.$db->engine.'.dll'); } else { @dl($db->engine.'.so'); } // Check again to see if we've been able to load it if(!extension_loaded($db->engine)) { // Throw our super awesome db loading error $mybb->trigger_generic_error("sql_load_error"); }
| { // Throw our super awesome db loading error $mybb->trigger_generic_error("sql_load_error");
|
}
require_once MYBB_ROOT."inc/class_templates.php";
| }
require_once MYBB_ROOT."inc/class_templates.php";
|
Zeile 197 | Zeile 201 |
---|
$mybb->settings = &$settings; $mybb->parse_cookies(); $mybb->cache = &$cache;
|
$mybb->settings = &$settings; $mybb->parse_cookies(); $mybb->cache = &$cache;
|
| if($mybb->settings['useshutdownfunc'] != 0) { $mybb->use_shutdown = true; register_shutdown_function(array(&$mybb, "__destruct")); }
|
// Load plugins if(!defined("NO_PLUGINS"))
| // Load plugins if(!defined("NO_PLUGINS"))
|
Zeile 206 | Zeile 216 |
---|
// Set up any shutdown functions we need to run globally add_shutdown('send_mail_queue');
|
// Set up any shutdown functions we need to run globally add_shutdown('send_mail_queue');
|
// Generate a random number for performing random actions. $rand = mt_rand(0, 10);
| |
/* URL Definitions */ if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))
| /* URL Definitions */ if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && $_SERVER['SEO_SUPPORT'] == 1))
|