From 494dd4110b04dc2543fdddd376d4baebac0ee0fe Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 29 Mar 2014 21:29:22 +0100 Subject: [PATCH] [ticket/12150] Use log service instead of add_log() function PHPBB3-12150 --- phpBB/config/cron_tasks.yml | 1 + phpBB/phpbb/cron/task/core/prune_shadow_topics.php | 7 +++++-- 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;