aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2015-06-22 00:45:42 +0200
committerAndreas Fischer <bantu@phpbb.com>2015-06-22 00:45:42 +0200
commit8213f24b352ce2ea714686738fefc70acccf0681 (patch)
tree6da20e0f196098cbb558fcdefd047e87b0913ef7
parent759eb2921596852bd595e2e4b02f40ca4b3f2dcf (diff)
parentd43da6cee93c9caff133edd754756db9550520da (diff)
downloadforums-8213f24b352ce2ea714686738fefc70acccf0681.tar
forums-8213f24b352ce2ea714686738fefc70acccf0681.tar.gz
forums-8213f24b352ce2ea714686738fefc70acccf0681.tar.bz2
forums-8213f24b352ce2ea714686738fefc70acccf0681.tar.xz
forums-8213f24b352ce2ea714686738fefc70acccf0681.zip
Merge branch '3.1.x'
* 3.1.x: [ticket/13952] Fix docblocks [ticket/13952] Inject dispatcher dependency to the tidy search cron task
-rw-r--r--phpBB/config/default/container/services_cron.yml1
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_search.php51
2 files changed, 45 insertions, 7 deletions
diff --git a/phpBB/config/default/container/services_cron.yml b/phpBB/config/default/container/services_cron.yml
index 7a90c39733..c5b88df181 100644
--- a/phpBB/config/default/container/services_cron.yml
+++ b/phpBB/config/default/container/services_cron.yml
@@ -120,6 +120,7 @@ services:
- @config
- @dbal.conn
- @user
+ - @dispatcher
calls:
- [set_name, [cron.task.core.tidy_search]]
tags:
diff --git a/phpBB/phpbb/cron/task/core/tidy_search.php b/phpBB/phpbb/cron/task/core/tidy_search.php
index ce16b3f988..eb3970254f 100644
--- a/phpBB/phpbb/cron/task/core/tidy_search.php
+++ b/phpBB/phpbb/cron/task/core/tidy_search.php
@@ -20,24 +20,60 @@ namespace phpbb\cron\task\core;
*/
class tidy_search extends \phpbb\cron\task\base
{
+ /**
+ * phpBB root path
+ * @var string
+ */
protected $phpbb_root_path;
+
+ /**
+ * PHP file extension
+ * @var string
+ */
protected $php_ext;
+
+ /**
+ * Auth object
+ * @var \phpbb\auth\auth
+ */
protected $auth;
+
+ /**
+ * Config object
+ * @var \phpbb\config\config
+ */
protected $config;
+
+ /**
+ * Database object
+ * @var \phpbb\db\driver\driver_interface
+ */
protected $db;
+
+ /**
+ * User object
+ * @var \phpbb\user
+ */
protected $user;
/**
+ * Event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
* Constructor.
*
- * @param string $phpbb_root_path The root path
+ * @param string $phpbb_root_path The phpBB root path
* @param string $php_ext The PHP file extension
- * @param \phpbb\auth\auth $auth The auth
- * @param \phpbb\config\config $config The config
- * @param \phpbb\db\driver\driver_interface $db The db connection
- * @param \phpbb\user $user The user
+ * @param \phpbb\auth\auth $auth The auth object
+ * @param \phpbb\config\config $config The config object
+ * @param \phpbb\db\driver\driver_interface $db The database object
+ * @param \phpbb\user $user The user object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher The event dispatcher object
*/
- public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user)
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\event\dispatcher_interface $phpbb_dispatcher)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
@@ -45,6 +81,7 @@ class tidy_search extends \phpbb\cron\task\base
$this->config = $config;
$this->db = $db;
$this->user = $user;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
}
/**
@@ -58,7 +95,7 @@ class tidy_search extends \phpbb\cron\task\base
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
- $search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user);
+ $search = new $search_type($error, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user, $this->phpbb_dispatcher);
if (!$error)
{