forked from pcrumm/phpbb.json
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap_phpbb.php
More file actions
46 lines (38 loc) · 1 KB
/
Copy pathbootstrap_phpbb.php
File metadata and controls
46 lines (38 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @package phpbb.json
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/**
*/
define('IN_PHPBB', true);
// Setup the variables we need to include phpBB the proper way
$phpbb_root_path = PHPBB_ROOT;
$phpEx = PHPBB_PHP_EXT;
// DB configuration
if (file_exists($phpbb_root_path . 'config.' . $phpEx))
{
include($phpbb_root_path . 'config.' . $phpEx);
}
else
{
throw new \phpBBJSON\Exception\InternalError('Config file not found');
}
// And the DBAL
if (isset($dbms))
{
include ($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
}
else
{
throw new \phpBBJSON\Exception\InternalError('Config file not properly formatted');
}
// Setup our phpBB "container"
include(INCLUDES_DIR . 'phpbb.' . $phpEx);
$phpbb = new phpBBJSON\phpbb();
// Setup the dbal
$dbal_driver = 'dbal_' . $dbms;
$phpbb_db = new $dbal_driver();
$phpbb_db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false);
unset($dbpasswd); // For security purposes
$phpbb->set_db($phpbb_db);