diff options
author | Andreas Fischer <bantu@phpbb.com> | 2014-07-17 17:19:36 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2014-07-17 20:37:24 +0200 |
commit | 07ce29c081c8bbd24a5094d89346be33dda583c5 (patch) | |
tree | f2ad07531041bbc70a49ead9d3fbca4c3e0205d6 /phpBB/phpbb/console | |
parent | 42477861a45935b10285a1434f4ffaf5b199c5c2 (diff) | |
download | forums-07ce29c081c8bbd24a5094d89346be33dda583c5.tar forums-07ce29c081c8bbd24a5094d89346be33dda583c5.tar.gz forums-07ce29c081c8bbd24a5094d89346be33dda583c5.tar.bz2 forums-07ce29c081c8bbd24a5094d89346be33dda583c5.tar.xz forums-07ce29c081c8bbd24a5094d89346be33dda583c5.zip |
[ticket/12656] Pass user object into all console commands.
PHPBB3-12656
Diffstat (limited to 'phpBB/phpbb/console')
-rw-r--r-- | phpBB/phpbb/console/command/cache/purge.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/command.php | 13 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/config/command.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/cron/cron_list.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/cron/run.php | 10 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/db/migrate.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/dev/migration_tips.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/extension/command.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/fixup/recalculate_email_hash.php | 4 |
9 files changed, 32 insertions, 35 deletions
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php index 379d2aa1ca..8c51d1b5a8 100644 --- a/phpBB/phpbb/console/command/cache/purge.php +++ b/phpBB/phpbb/console/command/cache/purge.php @@ -29,31 +29,27 @@ class purge extends \phpbb\console\command\command /** @var \phpbb\log\log */ protected $log; - /** @var \phpbb\user */ - protected $user; - /** @var \phpbb\config\config */ protected $config; /** * Constructor * + * @param \phpbb\user $user User instance * @param \phpbb\cache\driver\driver_interface $cache Cache instance * @param \phpbb\db\driver\driver_interface $db Database connection * @param \phpbb\auth\auth $auth Auth instance * @param \phpbb\log\log $log Logger instance - * @param \phpbb\user $user User instance * @param \phpbb\config\config $config Config instance */ - public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\user $user, \phpbb\config\config $config) + public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\config\config $config) { $this->cache = $cache; $this->db = $db; $this->auth = $auth; $this->log = $log; - $this->user = $user; $this->config = $config; - parent::__construct(); + parent::__construct($user); } /** diff --git a/phpBB/phpbb/console/command/command.php b/phpBB/phpbb/console/command/command.php index d3449c0c38..638c989da2 100644 --- a/phpBB/phpbb/console/command/command.php +++ b/phpBB/phpbb/console/command/command.php @@ -15,4 +15,17 @@ namespace phpbb\console\command; abstract class command extends \Symfony\Component\Console\Command\Command { + /** @var \phpbb\user */ + protected $user; + + /** + * Constructor + * + * @param \phpbb\user $user User instance (mostly for translation) + */ + public function __construct(\phpbb\user $user) + { + $this->user = $user; + parent::__construct(); + } } diff --git a/phpBB/phpbb/console/command/config/command.php b/phpBB/phpbb/console/command/config/command.php index de3fbd7fa7..f0ad5d4d19 100644 --- a/phpBB/phpbb/console/command/config/command.php +++ b/phpBB/phpbb/console/command/config/command.php @@ -17,10 +17,10 @@ abstract class command extends \phpbb\console\command\command /** @var \phpbb\config\config */ protected $config; - function __construct(\phpbb\config\config $config) + function __construct(\phpbb\user $user, \phpbb\config\config $config) { $this->config = $config; - parent::__construct(); + parent::__construct($user); } } diff --git a/phpBB/phpbb/console/command/cron/cron_list.php b/phpBB/phpbb/console/command/cron/cron_list.php index 4f4228d9b3..c515fd9e80 100644 --- a/phpBB/phpbb/console/command/cron/cron_list.php +++ b/phpBB/phpbb/console/command/cron/cron_list.php @@ -20,20 +20,16 @@ class cron_list extends \phpbb\console\command\command /** @var \phpbb\cron\manager */ protected $cron_manager; - /** @var \phpbb\user */ - protected $user; - /** * Constructor * - * @param \phpbb\cron\manager $cron_manager Cron manager * @param \phpbb\user $user User instance + * @param \phpbb\cron\manager $cron_manager Cron manager */ - public function __construct(\phpbb\cron\manager $cron_manager, \phpbb\user $user) + public function __construct(\phpbb\user $user, \phpbb\cron\manager $cron_manager) { $this->cron_manager = $cron_manager; - $this->user = $user; - parent::__construct(); + parent::__construct($user); } /** diff --git a/phpBB/phpbb/console/command/cron/run.php b/phpBB/phpbb/console/command/cron/run.php index 0b365ece67..72ad1205ef 100644 --- a/phpBB/phpbb/console/command/cron/run.php +++ b/phpBB/phpbb/console/command/cron/run.php @@ -25,23 +25,19 @@ class run extends \phpbb\console\command\command /** @var \phpbb\lock\db */ protected $lock_db; - /** @var \phpbb\user */ - protected $user; - /** * Construct method * + * @param \phpbb\user $user The user object (used to get language information) * @param \phpbb\cron\manager $cron_manager The cron manager containing * the cron tasks to be executed. * @param \phpbb\lock\db $lock_db The lock for accessing database. - * @param \phpbb\user $user The user object (used to get language information) */ - public function __construct(\phpbb\cron\manager $cron_manager, \phpbb\lock\db $lock_db, \phpbb\user $user) + public function __construct(\phpbb\user $user, \phpbb\cron\manager $cron_manager, \phpbb\lock\db $lock_db) { $this->cron_manager = $cron_manager; $this->lock_db = $lock_db; - $this->user = $user; - parent::__construct(); + parent::__construct($user); } /** diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php index 2abeaf5268..758b125b13 100644 --- a/phpBB/phpbb/console/command/db/migrate.php +++ b/phpBB/phpbb/console/command/db/migrate.php @@ -32,19 +32,15 @@ class migrate extends \phpbb\console\command\command /** @var \phpbb\log\log */ protected $log; - /** @var \phpbb\user */ - protected $user; - - function __construct(\phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, \phpbb\user $user) + function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log) { $this->migrator = $migrator; $this->extension_manager = $extension_manager; $this->config = $config; $this->cache = $cache; $this->log = $log; - $this->user = $user; + parent::__construct($user); $this->user->add_lang(array('common', 'install', 'migrator')); - parent::__construct(); } protected function configure() diff --git a/phpBB/phpbb/console/command/dev/migration_tips.php b/phpBB/phpbb/console/command/dev/migration_tips.php index c2f61568ea..e1387b34ae 100644 --- a/phpBB/phpbb/console/command/dev/migration_tips.php +++ b/phpBB/phpbb/console/command/dev/migration_tips.php @@ -20,10 +20,10 @@ class migration_tips extends \phpbb\console\command\command /** @var \phpbb\extension\manager */ protected $extension_manager; - function __construct(\phpbb\extension\manager $extension_manager) + function __construct(\phpbb\user $user, \phpbb\extension\manager $extension_manager) { $this->extension_manager = $extension_manager; - parent::__construct(); + parent::__construct($user); } protected function configure() diff --git a/phpBB/phpbb/console/command/extension/command.php b/phpBB/phpbb/console/command/extension/command.php index 21bb640504..364d954082 100644 --- a/phpBB/phpbb/console/command/extension/command.php +++ b/phpBB/phpbb/console/command/extension/command.php @@ -20,11 +20,11 @@ abstract class command extends \phpbb\console\command\command /** @var \phpbb\log\log */ protected $log; - public function __construct(\phpbb\extension\manager $manager, \phpbb\log\log $log) + public function __construct(\phpbb\user $user, \phpbb\extension\manager $manager, \phpbb\log\log $log) { $this->manager = $manager; $this->log = $log; - parent::__construct(); + parent::__construct($user); } } diff --git a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php index ec04da4267..cb821cfe20 100644 --- a/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php +++ b/phpBB/phpbb/console/command/fixup/recalculate_email_hash.php @@ -20,11 +20,11 @@ class recalculate_email_hash extends \phpbb\console\command\command /** @var \phpbb\db\driver\driver_interface */ protected $db; - function __construct(\phpbb\db\driver\driver_interface $db) + function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db) { $this->db = $db; - parent::__construct(); + parent::__construct($user); } protected function configure() |