summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Burschka2012-10-30 03:58:46 +0100
committerChristoph Burschka2012-10-30 03:58:46 +0100
commitead63e003c997313f0aeccb03b504cb115926f36 (patch)
tree8de788518824982597365c6f6a1ce6b88bad3cdb
parentStart (diff)
downloadejabberd-auth-php-ead63e003c997313f0aeccb03b504cb115926f36.tar.gz
A version compatible with the stable phpBB3
-rw-r--r--phpbb-bridge/phpbb_bootstrap.php53
1 files changed, 21 insertions, 32 deletions
diff --git a/phpbb-bridge/phpbb_bootstrap.php b/phpbb-bridge/phpbb_bootstrap.php
index 3f7dee5..4ede950 100644
--- a/phpbb-bridge/phpbb_bootstrap.php
+++ b/phpbb-bridge/phpbb_bootstrap.php
@@ -2,50 +2,39 @@
define('IN_PHPBB', TRUE);
$phpEx = 'php';
-use Symfony\Component\Config\FileLocator;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
-
require($phpbb_root_path . 'includes/startup.' . $phpEx);
-require_once __DIR__ . '/noweb_user.php';
if (file_exists($phpbb_root_path . 'config.' . $phpEx))
{
require($phpbb_root_path . 'config.' . $phpEx);
}
-// Include files
-require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
-require($phpbb_root_path . 'includes/di/processor/interface.' . $phpEx);
-require($phpbb_root_path . 'includes/di/processor/config.' . $phpEx);
+if (!defined('PHPBB_INSTALLED'))
+{
+ file_put_contents('php://stderr', "phpBB needs to be installed first.\n");
+ exit;
+}
+// Include files
+require(__DIR__ . '/noweb_user.php');
+require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
+require($phpbb_root_path . 'includes/cache.' . $phpEx);
+require($phpbb_root_path . 'includes/auth.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
-require($phpbb_root_path . 'includes/db/' . ltrim($dbms, 'dbal_') . '.' . $phpEx);
+require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-// Set PHP error handler to ours
-set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
-
-$phpbb_container = new ContainerBuilder();
-$loader = new YamlFileLoader($phpbb_container, new FileLocator($phpbb_root_path.'/config'));
-$loader->load('services.yml');
-
-$processor = new phpbb_di_processor_config($phpbb_root_path . 'config.' . $phpEx, $phpbb_root_path, $phpEx);
-$processor->process($phpbb_container);
-
-// Setup class loader first
-$phpbb_class_loader = $phpbb_container->get('class_loader');
-$phpbb_class_loader_ext = $phpbb_container->get('class_loader.ext');
-
// Instantiate some basic classes
-$user = new noweb_user;
-$auth = $phpbb_container->get('auth');
-$db = $phpbb_container->get('dbal.conn');
-
-// Grab global variables, re-cache if necessary
-$config = $phpbb_container->get('config');
-set_config(null, null, null, $config);
-set_config_count(null, null, null, $config);
+$user = new noweb_user();
+$auth = new auth();
+$db = new $sql_db();
+$cache = new cache();
+
+// Connect to DB
+$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false);
+// We do not need this any longer, unset for safety purposes
+unset($dbpasswd);
+$config = $cache->obtain_config();