} } } $settings['wolcutoff'] = $settings['wolcutoffmins'] * 60; $settings['bbname_orig'] = $settings['bbname']; $settings['bbname'] = strip_tags($settings['bbname']); // Fix for people who for some specify a trailing slash on the board URL if (substr($settings['bburl'], -1) == "/") { $settings['bburl'] = my_substr($settings['bburl'], 0, -1); } $mybb->settings =& $settings; $mybb->parse_cookies(); require_once MYBB_ROOT . "inc/class_datacache.php"; $cache = new datacache(); // Load cache $cache->cache(); $mybb->cache =& $cache; require_once MYBB_ROOT . "inc/class_session.php"; $session = new session(); $session->init(); $mybb->session =& $session; // Include the necessary contants for installation $grouppermignore = array("gid", "type", "title", "description", "namestyle", "usertitle", "stars", "starimage", "image"); $groupzerogreater = array("pmquota", "maxreputationsday", "attachquota"); $displaygroupfields = array("title", "description", "namestyle", "usertitle", "stars", "starimage", "image"); $fpermfields = array("canview", "candlattachments", "canpostthreads", "canpostreplys", "canpostattachments", "canratethreads", "caneditposts", "candeleteposts", "candeletethreads", "caneditattachments", "canpostpolls", "canvotepolls", "cansearch"); // Include the installation resources require_once INSTALL_ROOT . "resources/output.php"; $output = new installerOutput(); $output->script = "upgrade.php"; $output->title = "Kreator aktualizacji MyBB";
/** * Runs the shutdown items after the page has been sent to the browser. * */ function run_shutdown() { global $config, $db, $cache, $plugins, $error_handler, $shutdown_functions, $shutdown_queries, $done_shutdown, $mybb; if ($done_shutdown == true || !$config || $error_handler->has_errors) { return; } // Missing the core? Build if (!is_object($mybb)) { require_once MYBB_ROOT . "inc/class_core.php"; $mybb = new MyBB(); // Load the settings require MYBB_ROOT . "inc/settings.php"; $mybb->settings =& $settings; } // If our DB has been deconstructed already (bad PHP 5.2.0), reconstruct if (!is_object($db)) { if (!isset($config) || empty($config['database']['type'])) { require MYBB_ROOT . "inc/config.php"; } if (isset($config)) { require_once MYBB_ROOT . "inc/db_" . $config['database']['type'] . ".php"; switch ($config['database']['type']) { case "sqlite": $db = new DB_SQLite(); break; case "pgsql": $db = new DB_PgSQL(); break; case "mysqli": $db = new DB_MySQLi(); break; default: $db = new DB_MySQL(); } $db->connect($config['database']); define("TABLE_PREFIX", $config['database']['table_prefix']); $db->set_table_prefix(TABLE_PREFIX); } } // Cache object deconstructed? reconstruct if (!is_object($cache)) { require_once MYBB_ROOT . "inc/class_datacache.php"; $cache = new datacache(); $cache->cache(); } // And finally.. plugins if (!is_object($plugins) && !defined("NO_PLUGINS") && !($mybb->settings['no_plugins'] == 1)) { require_once MYBB_ROOT . "inc/class_plugins.php"; $plugins = new pluginSystem(); $plugins->load(); } // We have some shutdown queries needing to be run if (is_array($shutdown_queries)) { // Loop through and run them all foreach ($shutdown_queries as $query) { $db->query($query); } } // Run any shutdown functions if we have them if (is_array($shutdown_functions)) { foreach ($shutdown_functions as $function) { call_user_func_array($function['function'], $function['arguments']); } } $done_shutdown = true; }