aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-11-14 12:38:06 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-11-14 12:38:06 +0100
commit692fbf732f46eac4e673d0e317cd145eb446c999 (patch)
treed62deab38d5d3356fef0fadc0c2393c7c5e606ff /phpBB/phpbb
parent8fd1f90e5fab3c558786c58d8c8a88d1fcc9f3dc (diff)
parent287c2550b8689a6fd34043ec4b5652997e9a6ab7 (diff)
downloadforums-692fbf732f46eac4e673d0e317cd145eb446c999.tar
forums-692fbf732f46eac4e673d0e317cd145eb446c999.tar.gz
forums-692fbf732f46eac4e673d0e317cd145eb446c999.tar.bz2
forums-692fbf732f46eac4e673d0e317cd145eb446c999.tar.xz
forums-692fbf732f46eac4e673d0e317cd145eb446c999.zip
Merge remote-tracking branch 'prototech/ticket/12008' into develop
* prototech/ticket/12008: [ticket/12008] Update the run time value for the prune notifications cron task [ticket/12008] The read_notification_last_gc config setting should be dynamic.
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php27
-rw-r--r--phpBB/phpbb/notification/manager.php9
2 files changed, 35 insertions, 1 deletions
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php
new file mode 100644
index 0000000000..050e679cc0
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_cron_p2.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class notifications_cron_p2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\notifications_cron');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Make read_notification_last_gc dynamic.
+ array('config.remove', array('read_notification_last_gc')),
+ array('config.add', array('read_notification_last_gc', 0, 1)),
+ );
+ }
+}
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);
}
/**