mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-26 05:08:52 +00:00
[feature/request-class] Use the request class in the installer & updater.
Just like common.php database_update.php and install/index.php need to include the request class files and create an instance for use in request_var. PHPBB3-9716
This commit is contained in:
parent
d87d9d96b2
commit
76e530196b
2 changed files with 15 additions and 4 deletions
|
@ -66,6 +66,9 @@ require($phpbb_root_path . 'includes/template.' . $phpEx);
|
||||||
require($phpbb_root_path . 'includes/session.' . $phpEx);
|
require($phpbb_root_path . 'includes/session.' . $phpEx);
|
||||||
require($phpbb_root_path . 'includes/auth.' . $phpEx);
|
require($phpbb_root_path . 'includes/auth.' . $phpEx);
|
||||||
|
|
||||||
|
require($phpbb_root_path . 'includes/request/deactivated_super_global.' . $phpEx);
|
||||||
|
require($phpbb_root_path . 'includes/request/request_interface.' . $phpEx);
|
||||||
|
require($phpbb_root_path . 'includes/request/request.' . $phpEx);
|
||||||
require($phpbb_root_path . 'includes/functions.' . $phpEx);
|
require($phpbb_root_path . 'includes/functions.' . $phpEx);
|
||||||
|
|
||||||
if (file_exists($phpbb_root_path . 'includes/functions_content.' . $phpEx))
|
if (file_exists($phpbb_root_path . 'includes/functions_content.' . $phpEx))
|
||||||
|
@ -92,10 +95,14 @@ else
|
||||||
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
|
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$request = new phpbb_request();
|
||||||
$user = new user();
|
$user = new user();
|
||||||
$cache = new cache();
|
$cache = new cache();
|
||||||
$db = new $sql_db();
|
$db = new $sql_db();
|
||||||
|
|
||||||
|
// make sure request_var uses this request instance
|
||||||
|
request_var($request, 0); // "dependency injection" for a function
|
||||||
|
|
||||||
// Add own hook handler, if present. :o
|
// Add own hook handler, if present. :o
|
||||||
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
|
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
|
||||||
{
|
{
|
||||||
|
@ -1947,7 +1954,7 @@ class updater_db_tools
|
||||||
'VCHAR_CI' => '[varchar] (255)',
|
'VCHAR_CI' => '[varchar] (255)',
|
||||||
'VARBINARY' => '[varchar] (255)',
|
'VARBINARY' => '[varchar] (255)',
|
||||||
),
|
),
|
||||||
|
|
||||||
'mssqlnative' => array(
|
'mssqlnative' => array(
|
||||||
'INT:' => '[int]',
|
'INT:' => '[int]',
|
||||||
'BINT' => '[float]',
|
'BINT' => '[float]',
|
||||||
|
@ -1977,7 +1984,7 @@ class updater_db_tools
|
||||||
'VCHAR_CI' => '[varchar] (255)',
|
'VCHAR_CI' => '[varchar] (255)',
|
||||||
'VARBINARY' => '[varchar] (255)',
|
'VARBINARY' => '[varchar] (255)',
|
||||||
),
|
),
|
||||||
|
|
||||||
'oracle' => array(
|
'oracle' => array(
|
||||||
'INT:' => 'number(%d)',
|
'INT:' => 'number(%d)',
|
||||||
'BINT' => 'number(20)',
|
'BINT' => 'number(20)',
|
||||||
|
@ -2124,7 +2131,7 @@ class updater_db_tools
|
||||||
case 'mssql_odbc':
|
case 'mssql_odbc':
|
||||||
$this->sql_layer = 'mssql';
|
$this->sql_layer = 'mssql';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mssqlnative':
|
case 'mssqlnative':
|
||||||
$this->sql_layer = 'mssqlnative';
|
$this->sql_layer = 'mssqlnative';
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -171,6 +171,10 @@ require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
||||||
|
|
||||||
$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx);
|
$class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx);
|
||||||
$class_loader->register();
|
$class_loader->register();
|
||||||
|
$request = new phpbb_request();
|
||||||
|
|
||||||
|
// make sure request_var uses this request instance
|
||||||
|
request_var($request, 0); // "dependency injection" for a function
|
||||||
|
|
||||||
// Try and load an appropriate language if required
|
// Try and load an appropriate language if required
|
||||||
$language = basename(request_var('language', ''));
|
$language = basename(request_var('language', ''));
|
||||||
|
@ -813,4 +817,4 @@ class module
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue