summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Burschka2012-11-02 23:22:10 +0100
committerChristoph Burschka2012-11-02 23:22:10 +0100
commit208f8862c654c282290731ae726eadff25a7c004 (patch)
treea906f52dfdb6ded0c542a6cb39e93627d27a7122
parentRefactoring of plugin names complete. (diff)
downloadejabberd-auth-php-208f8862c654c282290731ae726eadff25a7c004.tar.gz
Abort if phpBB 3.1 not installed; avoid error handler; set globals.
-rw-r--r--plugins/phpbb31/phpbb31_bootstrap.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/phpbb31/phpbb31_bootstrap.php b/plugins/phpbb31/phpbb31_bootstrap.php
index 740f230..9656c81 100644
--- a/plugins/phpbb31/phpbb31_bootstrap.php
+++ b/plugins/phpbb31/phpbb31_bootstrap.php
@@ -1,5 +1,6 @@
<?php
define('IN_PHPBB', TRUE);
+global $phpEx, $config, $db, $user;
$phpEx = 'php';
use Symfony\Component\Config\FileLocator;
@@ -19,6 +20,13 @@ if (file_exists($phpbb_root_path . 'config.' . $phpEx))
require($phpbb_root_path . 'config.' . $phpEx);
}
+
+if (!defined('PHPBB_INSTALLED'))
+ {
+ file_put_contents('php://stderr', "phpBB needs to be installed first.\n");
+ exit;
+ }
+
// Include files
require($phpbb_root_path . 'includes/class_loader.' . $phpEx);
require($phpbb_root_path . 'includes/di/processor/interface.' . $phpEx);
@@ -31,9 +39,6 @@ require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . ltrim($dbms, 'dbal_') . '.' . $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');