From 7aa8f6461f1e85cf91931f56b95384e54fec07c2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer <bantu@phpbb.com> Date: Wed, 30 Oct 2013 13:05:28 +0100 Subject: [task/code-sniffer] Remove the IN_PHPBB check side-effect from class files. PHPBB3-11980 --- phpBB/phpbb/notification/manager.php | 8 -------- 1 file changed, 8 deletions(-) (limited to 'phpBB/phpbb/notification/manager.php') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index b92b247c74..a3c9425183 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -9,14 +9,6 @@ namespace phpbb\notification; -/** -* @ignore -*/ -if (!defined('IN_PHPBB')) -{ - exit; -} - /** * Notifications service class * @package notifications -- cgit v1.2.1 From ef1f99183796f8e246f96bca54ca439bf8ea1750 Mon Sep 17 00:00:00 2001 From: Andreas Fischer <bantu@phpbb.com> Date: Wed, 30 Oct 2013 13:37:29 +0100 Subject: [task/code-sniffer] Replace spaces with tabs. PHPBB3-11980 --- phpBB/phpbb/notification/manager.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/notification/manager.php') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index a3c9425183..d77a936413 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -254,8 +254,7 @@ class manager SET notification_read = 1 WHERE notification_time <= " . (int) $time . (($notification_type_name !== false) ? ' AND ' . - (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) - : '') . + (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) : '') . (($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '') . (($item_id !== false) ? ' AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) : ''); $this->db->sql_query($sql); @@ -277,8 +276,7 @@ class manager SET notification_read = 1 WHERE notification_time <= " . (int) $time . (($notification_type_name !== false) ? ' AND ' . - (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) - : '') . + (is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) : '') . (($item_parent_id !== false) ? ' AND ' . (is_array($item_parent_id) ? $this->db->sql_in_set('item_parent_id', $item_parent_id) : 'item_parent_id = ' . (int) $item_parent_id) : '') . (($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : ''); $this->db->sql_query($sql); -- cgit v1.2.1 From 287c2550b8689a6fd34043ec4b5652997e9a6ab7 Mon Sep 17 00:00:00 2001 From: Cesar G <prototech91@gmail.com> Date: Wed, 13 Nov 2013 23:58:21 -0800 Subject: [ticket/12008] Update the run time value for the prune notifications cron task PHPBB3-12008 --- phpBB/phpbb/notification/manager.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/notification/manager.php') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index d77a936413..2e8652771b 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -27,6 +27,9 @@ class manager /** @var \phpbb\user_loader */ protected $user_loader; + /** @var \phpbb\config\config */ + protected $config; + /** @var \phpbb\db\driver\driver */ protected $db; @@ -58,6 +61,7 @@ class manager * @param array $notification_methods * @param ContainerBuilder $phpbb_container * @param \phpbb\user_loader $user_loader + * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver $db * @param \phpbb\user $user * @param string $phpbb_root_path @@ -67,13 +71,14 @@ class manager * @param string $user_notifications_table * @return \phpbb\notification\manager */ - public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\db\driver\driver $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) + public function __construct($notification_types, $notification_methods, $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) { $this->notification_types = $notification_types; $this->notification_methods = $notification_methods; $this->phpbb_container = $phpbb_container; $this->user_loader = $user_loader; + $this->config = $config; $this->db = $db; $this->cache = $cache; $this->user = $user; @@ -797,6 +802,8 @@ class manager WHERE notification_time < ' . (int) $timestamp . (($only_read) ? ' AND notification_read = 1' : ''); $this->db->sql_query($sql); + + $this->config->set('read_notification_last_gc', time(), false); } /** -- cgit v1.2.1