mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 22:38:52 +00:00
[ticket/13952] Inject dispatcher dependency to the tidy search cron task
PHPBB3-13952
This commit is contained in:
parent
da7b24449d
commit
a8fe3926dc
2 changed files with 6 additions and 2 deletions
|
@ -120,6 +120,7 @@ services:
|
||||||
- @config
|
- @config
|
||||||
- @dbal.conn
|
- @dbal.conn
|
||||||
- @user
|
- @user
|
||||||
|
- @dispatcher
|
||||||
calls:
|
calls:
|
||||||
- [set_name, [cron.task.core.tidy_search]]
|
- [set_name, [cron.task.core.tidy_search]]
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -26,6 +26,7 @@ class tidy_search extends \phpbb\cron\task\base
|
||||||
protected $config;
|
protected $config;
|
||||||
protected $db;
|
protected $db;
|
||||||
protected $user;
|
protected $user;
|
||||||
|
protected $phpbb_dispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -36,8 +37,9 @@ class tidy_search extends \phpbb\cron\task\base
|
||||||
* @param \phpbb\config\config $config The config
|
* @param \phpbb\config\config $config The config
|
||||||
* @param \phpbb\db\driver\driver_interface $db The db connection
|
* @param \phpbb\db\driver\driver_interface $db The db connection
|
||||||
* @param \phpbb\user $user The user
|
* @param \phpbb\user $user The user
|
||||||
|
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher The event dispatcher
|
||||||
*/
|
*/
|
||||||
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->phpbb_root_path = $phpbb_root_path;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
|
@ -45,6 +47,7 @@ class tidy_search extends \phpbb\cron\task\base
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
|
$this->phpbb_dispatcher = $phpbb_dispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +61,7 @@ class tidy_search extends \phpbb\cron\task\base
|
||||||
|
|
||||||
// We do some additional checks in the module to ensure it can actually be utilised
|
// We do some additional checks in the module to ensure it can actually be utilised
|
||||||
$error = false;
|
$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)
|
if (!$error)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue