Vergleich inc/init.php - 1.8.8 - 1.8.27

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 12Zeile 12
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");

if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");

 
}

// Fallback
if(!defined('THIS_SCRIPT'))
{
define('THIS_SCRIPT', 'unknown');

}

/* Defines the root directory for MyBB.

}

/* Defines the root directory for MyBB.

Zeile 20Zeile 26
	if you experience problems.

Always add a trailing slash to the end of the path.

	if you experience problems.

Always add a trailing slash to the end of the path.





	* Path to your copy of MyBB
*/
//define('MYBB_ROOT', "./");

	* Path to your copy of MyBB
*/
//define('MYBB_ROOT', "./");

Zeile 29Zeile 35
if(!defined('MYBB_ROOT'))
{
define('MYBB_ROOT', dirname(dirname(__FILE__))."/");

if(!defined('MYBB_ROOT'))
{
define('MYBB_ROOT', dirname(dirname(__FILE__))."/");

}


}


define("TIME_NOW", time());

if(function_exists('date_default_timezone_set') && !ini_get('date.timezone'))

define("TIME_NOW", time());

if(function_exists('date_default_timezone_set') && !ini_get('date.timezone'))

Zeile 40Zeile 46

require_once MYBB_ROOT."inc/class_error.php";
$error_handler = new errorHandler();


require_once MYBB_ROOT."inc/class_error.php";
$error_handler = new errorHandler();

 

// Show errors triggered during initialization
$error_handler->force_display_errors = true;


if(!function_exists('json_encode') || !function_exists('json_decode'))
{


if(!function_exists('json_encode') || !function_exists('json_decode'))
{

Zeile 68Zeile 77
	if(!isset($config['database']))
{
$not_installed = true;

	if(!isset($config['database']))
{
$not_installed = true;

	}

	}

}

if($not_installed !== false)

}

if($not_installed !== false)

Zeile 88Zeile 97
}

if(!is_array($config['database']))

}

if(!is_array($config['database']))

{

{

	$mybb->trigger_generic_error("board_not_upgraded");

	$mybb->trigger_generic_error("board_not_upgraded");

}


}


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"))

{

{

	$mybb->trigger_generic_error("install_directory");
}

	$mybb->trigger_generic_error("install_directory");
}





// Load DB interface
require_once MYBB_ROOT."inc/db_base.php";

// Load DB interface
require_once MYBB_ROOT."inc/db_base.php";

 
require_once MYBB_ROOT . 'inc/AbstractPdoDbDriver.php';


require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";



require_once MYBB_ROOT."inc/db_".$config['database']['type'].".php";


Zeile 112Zeile 122
{
case "sqlite":
$db = new DB_SQLite;

{
case "sqlite":
$db = new DB_SQLite;

		break;

		break;

	case "pgsql":
$db = new DB_PgSQL;

	case "pgsql":
$db = new DB_PgSQL;

		break;




		break;
case "pgsql_pdo":
$db = new PostgresPdoDbDriver();
break;

	case "mysqli":
$db = new DB_MySQLi;

	case "mysqli":
$db = new DB_MySQLi;

 
		break;
case "mysql_pdo":
$db = new MysqlPdoDbDriver();

		break;
default:
$db = new DB_MySQL;

		break;
default:
$db = new DB_MySQL;

Zeile 204Zeile 220
{
$cache->update("internal_settings", array('encryption_key' => random_str(32)));
$settings['internal'] = $cache->read("internal_settings");

{
$cache->update("internal_settings", array('encryption_key' => random_str(32)));
$settings['internal'] = $cache->read("internal_settings");

}


}


$mybb->settings = &$settings;
$mybb->parse_cookies();
$mybb->cache = &$cache;
$mybb->asset_url = $mybb->get_asset_url();

if($mybb->use_shutdown == true)

$mybb->settings = &$settings;
$mybb->parse_cookies();
$mybb->cache = &$cache;
$mybb->asset_url = $mybb->get_asset_url();

if($mybb->use_shutdown == true)

{

{

	register_shutdown_function('run_shutdown');
}

// Did we just upgrade to a new version and haven't run the upgrade scripts yet?
$version = $cache->read("version");
if(!defined("IN_INSTALL") && !defined("IN_UPGRADE") && $version['version_code'] < $mybb->version_code)

	register_shutdown_function('run_shutdown');
}

// Did we just upgrade to a new version and haven't run the upgrade scripts yet?
$version = $cache->read("version");
if(!defined("IN_INSTALL") && !defined("IN_UPGRADE") && $version['version_code'] < $mybb->version_code)

{

{

	$version_history = $cache->read("version_history");
if(empty($version_history) || file_exists(MYBB_ROOT."install/resources/upgrade".(int)(end($version_history)+1).".php"))
{
$mybb->trigger_generic_error("board_not_upgraded");
}
}

	$version_history = $cache->read("version_history");
if(empty($version_history) || file_exists(MYBB_ROOT."install/resources/upgrade".(int)(end($version_history)+1).".php"))
{
$mybb->trigger_generic_error("board_not_upgraded");
}
}

 

$error_handler->force_display_errors = false;


// Load plugins
if(!defined("NO_PLUGINS") && !($mybb->settings['no_plugins'] == 1))
{
$plugins->load();
}


// Load plugins
if(!defined("NO_PLUGINS") && !($mybb->settings['no_plugins'] == 1))
{
$plugins->load();
}


// Set up any shutdown functions we need to run globally
add_shutdown('send_mail_queue');

 

/* URL Definitions */
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && isset($_SERVER['SEO_SUPPORT']) && $_SERVER['SEO_SUPPORT'] == 1))


/* URL Definitions */
if($mybb->settings['seourls'] == "yes" || ($mybb->settings['seourls'] == "auto" && isset($_SERVER['SEO_SUPPORT']) && $_SERVER['SEO_SUPPORT'] == 1))