mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-16 13:44:12 +02:00
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
This commit is contained in:
@@ -95,17 +95,17 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||
|
||||
// Setup class loader first
|
||||
$phpbb_class_loader = new phpbb_class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader->register();
|
||||
|
||||
// Set up container (must be done here because extensions table may not exist)
|
||||
$container_extensions = array(
|
||||
new phpbb_di_extension_config($phpbb_root_path . 'config.' . $phpEx),
|
||||
new phpbb_di_extension_core($phpbb_root_path),
|
||||
new \phpbb\di\extension\config($phpbb_root_path . 'config.' . $phpEx),
|
||||
new \phpbb\di\extension\core($phpbb_root_path),
|
||||
);
|
||||
$container_passes = array(
|
||||
new phpbb_di_pass_collection_pass(),
|
||||
//new phpbb_di_pass_kernel_pass(),
|
||||
new \phpbb\di\pass\collection_pass(),
|
||||
//new \phpbb\di\pass\kernel_pass(),
|
||||
);
|
||||
$phpbb_container = phpbb_create_container($container_extensions, $phpbb_root_path, $phpEx);
|
||||
|
||||
@@ -230,7 +230,7 @@ while (!$migrator->finished())
|
||||
{
|
||||
$migrator->update();
|
||||
}
|
||||
catch (phpbb_db_migration_exception $e)
|
||||
catch (\phpbb\db\migration\exception $e)
|
||||
{
|
||||
echo $e->getLocalisedMessage($user);
|
||||
|
||||
|
@@ -90,9 +90,9 @@ include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
|
||||
require($phpbb_root_path . 'includes/functions_install.' . $phpEx);
|
||||
|
||||
// Setup class loader first
|
||||
$phpbb_class_loader = new phpbb_class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||
$phpbb_class_loader->register();
|
||||
$phpbb_class_loader_ext = new phpbb_class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext = new \phpbb\class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx);
|
||||
$phpbb_class_loader_ext->register();
|
||||
|
||||
// Set up container
|
||||
@@ -187,8 +187,8 @@ $sub = request_var('sub', '');
|
||||
// Set PHP error handler to ours
|
||||
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
|
||||
|
||||
$user = new phpbb_user();
|
||||
$auth = new phpbb_auth();
|
||||
$user = new \phpbb\user();
|
||||
$auth = new \phpbb\auth\auth();
|
||||
|
||||
// Add own hook handler, if present. :o
|
||||
if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
|
||||
@@ -208,14 +208,14 @@ else
|
||||
}
|
||||
|
||||
// Set some standard variables we want to force
|
||||
$config = new phpbb_config(array(
|
||||
$config = new \phpbb\config\config(array(
|
||||
'load_tplcompile' => '1'
|
||||
));
|
||||
|
||||
$phpbb_style_resource_locator = new phpbb_style_resource_locator();
|
||||
$phpbb_style_path_provider = new phpbb_style_path_provider();
|
||||
$template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
|
||||
$phpbb_style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template);
|
||||
$phpbb_style_resource_locator = new \phpbb\style\resource_locator();
|
||||
$phpbb_style_path_provider = new \phpbb\style\path_provider();
|
||||
$template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
|
||||
$phpbb_style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template);
|
||||
$phpbb_style->set_ext_dir_prefix('adm/');
|
||||
$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
|
||||
$template->assign_var('T_ASSETS_PATH', '../assets');
|
||||
|
@@ -130,7 +130,7 @@ class install_convert extends module
|
||||
unset($dbpasswd);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
@@ -345,7 +345,7 @@ class install_convert extends module
|
||||
$this->page_title = $lang['STAGE_SETTINGS'];
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
@@ -586,7 +586,7 @@ class install_convert extends module
|
||||
unset($dbpasswd);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
@@ -739,7 +739,7 @@ class install_convert extends module
|
||||
// For conversions we are a bit less strict and set to a search backend we know exist...
|
||||
if (!class_exists($search_type))
|
||||
{
|
||||
$search_type = 'phpbb_search_fulltext_native';
|
||||
$search_type = '\phpbb\search\fulltext_native';
|
||||
set_config('search_type', $search_type);
|
||||
}
|
||||
|
||||
|
@@ -102,7 +102,7 @@ class install_install extends module
|
||||
break;
|
||||
|
||||
case 'final':
|
||||
// Enable super globals to prevent issues with the new phpbb_request object
|
||||
// Enable super globals to prevent issues with the new \phpbb\request\request object
|
||||
$request->enable_super_globals();
|
||||
|
||||
// Create a normal container now
|
||||
@@ -1438,12 +1438,12 @@ class install_install extends module
|
||||
include_once($phpbb_root_path . 'phpbb/search/fulltext_native.' . $phpEx);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
$error = false;
|
||||
$search = new phpbb_search_fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
$search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);
|
||||
|
||||
$sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id
|
||||
FROM ' . POSTS_TABLE;
|
||||
@@ -1753,7 +1753,7 @@ class install_install extends module
|
||||
$data = $this->get_submitted_data();
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
@@ -1827,7 +1827,7 @@ class install_install extends module
|
||||
$data = $this->get_submitted_data();
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
@@ -1892,8 +1892,8 @@ class install_install extends module
|
||||
* "installs" means it adds all migrations to the migrations table, but does not
|
||||
* perform any of the actions in the migrations.
|
||||
*
|
||||
* @param phpbb_extension_manager $extension_manager
|
||||
* @param phpbb_db_migrator $migrator
|
||||
* @param \phpbb\extension\manager $extension_manager
|
||||
* @param \phpbb\db\migrator $migrator
|
||||
*/
|
||||
function populate_migrations($extension_manager, $migrator)
|
||||
{
|
||||
|
@@ -108,7 +108,7 @@ class install_update extends module
|
||||
unset($dbpasswd);
|
||||
|
||||
// We need to fill the config to let internal functions correctly work
|
||||
$config = new phpbb_config_db($db, new phpbb_cache_driver_null, CONFIG_TABLE);
|
||||
$config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
|
||||
set_config(null, null, null, $config);
|
||||
set_config_count(null, null, null, $config);
|
||||
|
||||
@@ -248,7 +248,7 @@ class install_update extends module
|
||||
$this->include_file('includes/diff/renderer.' . $phpEx);
|
||||
|
||||
// Make sure we stay at the file check if checking the files again
|
||||
if ($request->variable('check_again', false, false, phpbb_request_request_interface::POST))
|
||||
if ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST))
|
||||
{
|
||||
$sub = $this->p_master->sub = 'file_check';
|
||||
}
|
||||
@@ -355,7 +355,7 @@ class install_update extends module
|
||||
$action = request_var('action', '');
|
||||
|
||||
// We are directly within an update. To make sure our update list is correct we check its status.
|
||||
$update_list = ($request->variable('check_again', false, false, phpbb_request_request_interface::POST)) ? false : $cache->get('_update_list');
|
||||
$update_list = ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST)) ? false : $cache->get('_update_list');
|
||||
$modified = ($update_list !== false) ? @filemtime($cache->get_driver()->cache_dir . 'data_update_list.' . $phpEx) : 0;
|
||||
|
||||
// Make sure the list is up-to-date
|
||||
|
Reference in New Issue
Block a user