Skip to content

Commit e5bd954

Browse files
authored
Merge pull request #40 from Crizz0/issue/39
Remove not needed services/parameter from cron/main.php
2 parents c6ebd4b + 7977ecc commit e5bd954

File tree

3 files changed

+11
-39
lines changed

3 files changed

+11
-39
lines changed

config/services.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,8 @@ services:
5454
phpbbde.pastebin.cron.main:
5555
class: phpbbde\pastebin\cron\main
5656
arguments:
57-
- '@cache'
5857
- '@config'
5958
- '@dbal.conn'
60-
- '@log'
61-
- '%phpbbde.pastebin.path%'
62-
- '%core.root_path%'
63-
- '%core.php_ext%'
6459
- '%phpbbde.pastebin.cron.prune_interval%'
6560
- '%tables.phpbbde.pastebin.pastebin%'
6661
calls:

cron/main.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,23 @@
1212

1313
class main extends \phpbb\cron\task\base
1414
{
15-
/** @var string phpBB root path */
16-
protected $root_path;
17-
18-
/** @var string phpEx */
19-
protected $php_ext;
20-
2115
/** @var \phpbb\db\driver\driver_interface */
2216
protected $db;
2317

24-
/** @var \phpbb\cache\service */
25-
protected $cache;
26-
2718
/** @var \phpbb\config\config */
2819
protected $config;
2920

30-
/** @var \phpbb\log\log_interface */
31-
protected $log;
32-
protected $pastebin_path;
3321
protected $prune_interval;
3422
protected $pastebin_table;
3523

36-
public function __construct(\phpbb\cache\service $cache, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\log\log_interface $log, $pastebin_path, $root_path, $php_ext, $prune_interval, $pastebin_table)
24+
public function __construct(
25+
\phpbb\config\config $config,
26+
\phpbb\db\driver\driver_interface $db,
27+
$prune_interval,
28+
$pastebin_table)
3729
{
38-
$this->cache = $cache;
3930
$this->config = $config;
4031
$this->db = $db;
41-
$this->log = $log;
42-
$this->pastebin_path = $pastebin_path;
43-
$this->root_path = $root_path;
44-
$this->php_ext = $php_ext;
4532
$this->prune_interval = $prune_interval;
4633
$this->pastebin_table = $pastebin_table;
4734
}

migrations/pastebin.php

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212

1313
class pastebin extends \phpbb\db\migration\migration
1414
{
15-
static public function depends_on()
15+
public function effectively_installed()
1616
{
17-
return array();
17+
return !empty($this->config['pastebin_version']) && version_compare($this->config['pastebin_version'], '0.2.2', '>=');
1818
}
1919

20-
public function effectively_installed()
20+
static public function depends_on()
2121
{
22-
return !empty($this->config['pastebin_version']) && version_compare($this->config['pastebin_version'], '0.2.2', '>=');
22+
return array(
23+
'\phpbb\db\migration\data\v32x\v324',
24+
);
2325
}
2426

2527
public function update_schema()
@@ -65,16 +67,4 @@ public function update_data()
6567
array('config.add', array('pastebin_version', '0.2.2')),
6668
);
6769
}
68-
69-
public function revert_data()
70-
{
71-
return array(
72-
array('permission.remove', array('u_pastebin_view')),
73-
array('permission.remove', array('u_pastebin_post')),
74-
array('permission.remove', array('u_pastebin_post_novc')),
75-
array('permission.remove', array('m_pastebin_edit')),
76-
array('permission.remove', array('m_pastebin_delete')),
77-
array('config.remove', array('pastebin_version')),
78-
);
79-
}
8070
}

0 commit comments

Comments
 (0)