aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/config/cron_tasks.yml1
-rw-r--r--phpBB/phpbb/cron/task/core/prune_shadow_topics.php7
2 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/config/cron_tasks.yml b/phpBB/config/cron_tasks.yml
index 3fd049f567..4fa5d1440e 100644
--- a/phpBB/config/cron_tasks.yml
+++ b/phpBB/config/cron_tasks.yml
@@ -30,6 +30,7 @@ services:
- %core.php_ext%
- @config
- @dbal.conn
+ - @log
calls:
- [set_name, [cron.task.core.prune_shadow_topics]]
tags:
diff --git a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
index 75165d900d..b30e665a87 100644
--- a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
+++ b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
@@ -24,6 +24,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
protected $php_ext;
protected $config;
protected $db;
+ protected $log;
/**
* If $forum_data is given, it is assumed to contain necessary information
@@ -42,13 +43,15 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
* @param string $php_ext The PHP extension
* @param \phpbb\config\config $config The config
* @param \phpbb\db\driver\driver $db The db connection
+ * @param \phpbb\log\log $log The phpBB log system
*/
- public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver $db)
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\log\log $log)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->config = $config;
$this->db = $db;
+ $this->log = $log;
}
/**
@@ -180,7 +183,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
WHERE forum_id = $forum_id";
$this->db->sql_query($sql);
- add_log('admin', 'LOG_PRUNE_SHADOW', $row['forum_name']);
+ $this->log->add('admin', 'LOG_PRUNE_SHADOW', $row['forum_name']);
}
return;