aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/notification/method
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/notification/method')
-rw-r--r--phpBB/includes/notification/method/base.php30
-rw-r--r--phpBB/includes/notification/method/email.php6
-rw-r--r--phpBB/includes/notification/method/jabber.php6
3 files changed, 16 insertions, 26 deletions
diff --git a/phpBB/includes/notification/method/base.php b/phpBB/includes/notification/method/base.php
index b502d3afd0..ced85e2582 100644
--- a/phpBB/includes/notification/method/base.php
+++ b/phpBB/includes/notification/method/base.php
@@ -23,12 +23,7 @@ if (!defined('IN_PHPBB'))
*/
abstract class phpbb_notification_method_base implements phpbb_notification_method_interface
{
- protected $phpbb_container;
- protected $service;
- protected $db;
- protected $user;
- protected $phpbb_root_path;
- protected $php_ext;
+ protected $notification_manager, $db, $cache, $template, $extension_manager, $user, $auth, $config, $phpbb_root_path, $php_ext = null;
/**
* Desired notifications
@@ -56,20 +51,17 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
*/
protected $queue = array();
- public function __construct(ContainerBuilder $phpbb_container)
+ public function __construct(dbal $db, phpbb_cache_driver_interface $cache, phpbb_template $template, phpbb_extension_manager $extension_manager, phpbb_user $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext)
{
- // phpBB Container
- $this->phpbb_container = $phpbb_container;
-
- // Service
- $this->service = $phpbb_container->get('notifications');
-
- // Some common things we're going to use
- $this->db = $phpbb_container->get('dbal.conn');
- $this->user = $phpbb_container->get('user');
-
- $this->phpbb_root_path = $phpbb_container->getParameter('core.root_path');
- $this->php_ext = $phpbb_container->getParameter('core.php_ext');
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->template = $template;
+ $this->extension_manager = $extension_manager;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->config = $config;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
}
/**
diff --git a/phpBB/includes/notification/method/email.php b/phpBB/includes/notification/method/email.php
index 1b6b44d137..c2e272aca1 100644
--- a/phpBB/includes/notification/method/email.php
+++ b/phpBB/includes/notification/method/email.php
@@ -57,12 +57,12 @@ class phpbb_notification_method_email extends phpbb_notification_method_base
// We do not send emails to banned users
if (!function_exists('phpbb_get_banned_user_ids'))
{
- include($this->phpbb_container->getParameter('core.root_path') . 'includes/functions_user.' . $this->phpbb_container->getParameter('core.php_ext'));
+ include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
}
$banned_users = phpbb_get_banned_user_ids($user_ids);
// Load all the users we need
- $this->service->load_users($user_ids);
+ $this->notification_manager->load_users($user_ids);
// Load the messenger
if (!class_exists('messenger'))
@@ -75,7 +75,7 @@ class phpbb_notification_method_email extends phpbb_notification_method_base
// Time to go through the queue and send emails
foreach ($this->queue as $notification)
{
- $user = $this->service->get_user($notification->user_id);
+ $user = $this->notification_manager->get_user($notification->user_id);
if ($user['user_type'] == USER_IGNORE || in_array($notification->user_id, $banned_users))
{
diff --git a/phpBB/includes/notification/method/jabber.php b/phpBB/includes/notification/method/jabber.php
index 9232d8fc45..664e387d61 100644
--- a/phpBB/includes/notification/method/jabber.php
+++ b/phpBB/includes/notification/method/jabber.php
@@ -36,7 +36,7 @@ class phpbb_notification_method_jabber extends phpbb_notification_method_email
*/
public function is_available()
{
- return ($this->global_available() && $this->phpbb_container->get('user')->data['jabber']);
+ return ($this->global_available() && $this->user->data['jabber']);
}
/**
@@ -45,9 +45,7 @@ class phpbb_notification_method_jabber extends phpbb_notification_method_email
*/
public function global_available()
{
- $config = $this->phpbb_container->get('config');
-
- return ($config['jab_enable'] && @extension_loaded('xml'));
+ return ($this->config['jab_enable'] && @extension_loaded('xml'));
}
public function notify()