aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/controller
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-11-13 09:26:31 -0500
committerDavid King <imkingdavid@gmail.com>2012-11-16 16:45:28 -0500
commit7687f069611b35f81c6d0fc87e46b9bb0821d616 (patch)
tree42599df5133de421fdec07cc0bf5ab61de59b024 /phpBB/includes/controller
parent6e647cf6e142da3ddf304275803e708501daeb82 (diff)
downloadforums-7687f069611b35f81c6d0fc87e46b9bb0821d616.tar
forums-7687f069611b35f81c6d0fc87e46b9bb0821d616.tar.gz
forums-7687f069611b35f81c6d0fc87e46b9bb0821d616.tar.bz2
forums-7687f069611b35f81c6d0fc87e46b9bb0821d616.tar.xz
forums-7687f069611b35f81c6d0fc87e46b9bb0821d616.zip
[feature/controller] Inject dependencies instead of container
PHPBB3-10864
Diffstat (limited to 'phpBB/includes/controller')
-rw-r--r--phpBB/includes/controller/helper.php42
1 files changed, 21 insertions, 21 deletions
diff --git a/phpBB/includes/controller/helper.php b/phpBB/includes/controller/helper.php
index f3127fd1fc..0fc3ba0c67 100644
--- a/phpBB/includes/controller/helper.php
+++ b/phpBB/includes/controller/helper.php
@@ -15,9 +15,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Controller helper class, contains methods that do things for controllers
@@ -26,25 +24,25 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
class phpbb_controller_helper
{
/**
- * Container
- * @var ContainerBuilder
- */
- protected $container;
-
- /**
* Template object
* @var phpbb_template
*/
protected $template;
/**
- * phpBB Root Path
+ * User object
+ * @var phpbb_user
+ */
+ protected $user;
+
+ /**
+ * phpBB root path
* @var string
*/
- protected $phpbb_root_path;
+ protected $root_path;
/**
- * PHP Extension
+ * PHP extension
* @var string
*/
protected $php_ext;
@@ -58,15 +56,17 @@ class phpbb_controller_helper
/**
* Constructor
*
- * @param ContainerBuilder $container DI Container
+ * @param phpbb_template $template Template object
+ * @param phpbb_user $user User object
+ * @param string $root_path phpBB root path
+ * @param string $php_ext PHP extension
*/
- public function __construct(ContainerBuilder $container)
+ public function __construct(phpbb_template $template, phpbb_user $user, $root_path, $php_ext)
{
- $this->container = $container;
-
- $this->template = $this->container->get('template');
- $this->phpbb_root_path = $this->container->getParameter('core.root_path');
- $this->php_ext = $this->container->getParameter('core.php_ext');
+ $this->template = $template;
+ $this->user = $user;
+ $this->root_path = $root_path;
+ $this->php_ext = $php_ext;
}
/**
@@ -101,7 +101,7 @@ class phpbb_controller_helper
*/
public function url(array $url_parts, $query = '')
{
- return append_sid($this->phpbb_root_path . $this->url_base . implode('/', $url_parts), $query);
+ return append_sid($this->root_path . $this->url_base . implode('/', $url_parts), $query);
}
/**
@@ -129,9 +129,9 @@ class phpbb_controller_helper
{
$this->template->assign_vars(array(
'MESSAGE_TEXT' => $message,
- 'MESSAGE_TITLE' => $this->container->get('user')->lang('INFORMATION'),
+ 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),
));
- return $this->render('message_body.html', $this->container->get('user')->lang('INFORMATION'), $code);
+ return $this->render('message_body.html', $this->user->lang('INFORMATION'), $code);
}
}