예제 #1
0
// Include our core functions
titania::_include('functions');
set_exception_handler('titania_exception_handler');
// Set up our auto-loader
spl_autoload_register(array('titania', 'autoload'));
// Read config.php file
// 2 separate locations possible: within Titania directory and just outside of it.
if (file_exists(TITANIA_ROOT . 'config.' . PHP_EXT)) {
    titania::read_config_file(TITANIA_ROOT . 'config.' . PHP_EXT);
} else {
    titania::read_config_file(TITANIA_ROOT . '../config.' . PHP_EXT);
}
// Include the dynamic constants (after reading the Titania config file, but before loading the phpBB common file)
titania::_include('dynamic_constants');
// Decode the request
titania_url::decode_request();
// Include common phpBB files and functions.
if (!file_exists(PHPBB_ROOT_PATH . 'common.' . PHP_EXT)) {
    die('<p>No phpBB installation found. Check the Titania configuration file.</p>');
}
if (!defined('PHPBB_INCLUDED')) {
    require PHPBB_ROOT_PATH . 'common.' . PHP_EXT;
}
// Initialise phpBB
phpbb::initialise();
// If the database is not installed or outdated redirect to the installer
if (!defined('IN_TITANIA_INSTALL') && (!isset(phpbb::$config['titania_version']) || version_compare(phpbb::$config['titania_version'], TITANIA_VERSION, '<'))) {
    if (phpbb::$user->data['user_type'] != USER_FOUNDER) {
        phpbb::$user->set_custom_lang_path(TITANIA_ROOT . 'language/');
        phpbb::$user->add_lang('common');
        msg_handler(E_USER_ERROR, phpbb::$user->lang['TITANIA_DISABLED'], '', '');