From 35805a27408f4d25987c3f8df5c9bf54b15a19f3 Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 28 Mar 2012 16:48:16 -0400 Subject: [PATCH] [ticket/10586] Moved some loading stuff below extension controller, updated tests PHPBB3-10586 --- phpBB/index.php | 7 +++++-- tests/functional/fixtures/ext/error/class/controller.php | 7 +++---- .../functional/fixtures/ext/error/disabled/controller.php | 7 +++---- tests/functional/fixtures/ext/foo/bar/controller.php | 7 +++---- tests/functional/fixtures/ext/foobar/controller.php | 7 +++---- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/phpBB/index.php b/phpBB/index.php index d71878a885..9a57105d57 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -17,12 +17,11 @@ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); -include($phpbb_root_path . 'includes/functions_display.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); -$user->setup('viewforum'); +$user->setup(); // Handle the display of extension front pages if ($ext = $request->variable('ext', '')) @@ -57,6 +56,10 @@ if ($ext = $request->variable('ext', '')) exit_handler(); } +include($phpbb_root_path . 'includes/functions_display.' . $phpEx); + +$user->add_lang('viewforum'); + display_forums('', $config['load_moderators']); $order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend'; diff --git a/tests/functional/fixtures/ext/error/class/controller.php b/tests/functional/fixtures/ext/error/class/controller.php index eb2ae362a6..99849584bc 100644 --- a/tests/functional/fixtures/ext/error/class/controller.php +++ b/tests/functional/fixtures/ext/error/class/controller.php @@ -1,13 +1,12 @@ set_ext_dir_prefix($phpbb_root_path . 'ext/error/class/'); + $this->template->set_ext_dir_prefix($this->phpbb_root_path . 'ext/error/class/'); - $template->set_filenames(array( + $this->template->set_filenames(array( 'body' => 'index_body.html' )); diff --git a/tests/functional/fixtures/ext/error/disabled/controller.php b/tests/functional/fixtures/ext/error/disabled/controller.php index b83a949020..ef2edda3de 100644 --- a/tests/functional/fixtures/ext/error/disabled/controller.php +++ b/tests/functional/fixtures/ext/error/disabled/controller.php @@ -1,13 +1,12 @@ set_ext_dir_prefix($phpbb_root_path . 'ext/error/disabled/'); + $this->template->set_ext_dir_prefix($this->phpbb_root_path . 'ext/error/disabled/'); - $template->set_filenames(array( + $this->template->set_filenames(array( 'body' => 'index_body.html' )); diff --git a/tests/functional/fixtures/ext/foo/bar/controller.php b/tests/functional/fixtures/ext/foo/bar/controller.php index 24d218c412..1910a4da88 100644 --- a/tests/functional/fixtures/ext/foo/bar/controller.php +++ b/tests/functional/fixtures/ext/foo/bar/controller.php @@ -1,13 +1,12 @@ set_ext_dir_prefix($phpbb_root_path . 'ext/foo/bar/'); + $this->template->set_ext_dir_prefix($this->phpbb_root_path . 'ext/foo/bar/'); - $template->set_filenames(array( + $this->template->set_filenames(array( 'body' => 'foobar_body.html' )); diff --git a/tests/functional/fixtures/ext/foobar/controller.php b/tests/functional/fixtures/ext/foobar/controller.php index bf8d8139ae..5161b28fe8 100644 --- a/tests/functional/fixtures/ext/foobar/controller.php +++ b/tests/functional/fixtures/ext/foobar/controller.php @@ -1,13 +1,12 @@ set_ext_dir_prefix($phpbb_root_path . 'ext/foobar/'); + $this->template->set_ext_dir_prefix($this->phpbb_root_path . 'ext/foobar/'); - $template->set_filenames(array( + $this->template->set_filenames(array( 'body' => 'foobar_body.html' ));