diff options
-rw-r--r-- | phpBB/common.php | 6 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 6 | ||||
-rw-r--r-- | phpBB/install/index.php | 5 | ||||
-rw-r--r-- | tests/request/request.php | 6 |
4 files changed, 15 insertions, 8 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index a4be46f987..57a1384ee4 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -195,6 +195,8 @@ require($phpbb_root_path . 'includes/template.' . $phpEx); require($phpbb_root_path . 'includes/session.' . $phpEx); require($phpbb_root_path . 'includes/auth.' . $phpEx); +require($phpbb_root_path . 'includes/request/type_cast_helper_interface.' . $phpEx); +require($phpbb_root_path . 'includes/request/type_cast_helper.' . $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); @@ -209,7 +211,7 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); // Instantiate some basic classes -$request = new phpbb_request(); +$request = new phpbb_request(new phpbb_type_cast_helper()); $user = new user(); $auth = new auth(); $template = new template(); @@ -220,7 +222,7 @@ $class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx, $cache); $class_loader->register(); // make sure request_var uses this request instance -request_var($request, 0); // "dependency injection" for a function +request_var('', 0, false, false, $request); // "dependency injection" for a function // Connect to DB $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, defined('PHPBB_DB_NEW_LINK') ? PHPBB_DB_NEW_LINK : false); diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index d571d41be4..483f24f3e5 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -66,6 +66,8 @@ require($phpbb_root_path . 'includes/template.' . $phpEx); require($phpbb_root_path . 'includes/session.' . $phpEx); require($phpbb_root_path . 'includes/auth.' . $phpEx); +require($phpbb_root_path . 'includes/request/type_cast_helper_interface.' . $phpEx); +require($phpbb_root_path . 'includes/request/type_cast_helper.' . $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); @@ -95,13 +97,13 @@ else define('STRIP', (get_magic_quotes_gpc()) ? true : false); } -$request = new phpbb_request(); +$request = new phpbb_request(new phpbb_type_cast_helper()); $user = new user(); $cache = new cache(); $db = new $sql_db(); // make sure request_var uses this request instance -request_var($request, 0); // "dependency injection" for a function +request_var('', 0, false, false, $request); // "dependency injection" for a function // Add own hook handler, if present. :o if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx)) diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 3e4331cde5..5862e2e8d2 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -171,10 +171,11 @@ require($phpbb_root_path . 'includes/functions_install.' . $phpEx); $class_loader = new phpbb_class_loader($phpbb_root_path, '.' . $phpEx); $class_loader->register(); -$request = new phpbb_request(); + +$request = new phpbb_request(new phpbb_type_cast_helper()); // make sure request_var uses this request instance -request_var($request, 0); // "dependency injection" for a function +request_var('', 0, false, false, $request); // "dependency injection" for a function // Try and load an appropriate language if required $language = basename(request_var('language', '')); diff --git a/tests/request/request.php b/tests/request/request.php index df71d783ed..ebfc3ba2b0 100644 --- a/tests/request/request.php +++ b/tests/request/request.php @@ -10,13 +10,13 @@ require_once 'test_framework/framework.php'; require_once '../phpBB/includes/request/type_cast_helper_interface.php'; -require_once '../phpBB/includes/request/type_cast_helper.php'; require_once '../phpBB/includes/request/request_interface.php'; require_once '../phpBB/includes/request/deactivated_super_global.php'; require_once '../phpBB/includes/request/request.php'; class phpbb_request_test extends phpbb_test_case { + private $type_cast_helper; private $request; protected function setUp() @@ -28,7 +28,9 @@ class phpbb_request_test extends phpbb_test_case $_REQUEST['test'] = 3; $_GET['unset'] = ''; - $this->request = new phpbb_request(); + $this->type_cast_helper = $this->getMock('phpbb_type_cast_helper_interface'); + + $this->request = new phpbb_request($this->type_cast_helper); } public function test_toggle_super_globals() |