aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-07-22 16:24:40 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-07-09 09:21:51 +0200
commit487fea8cfffe872e888ebcc3e1f5538b72bcaec1 (patch)
tree844be698767bbc2ad4aedc8beb3295658b61af55
parent54be6b1f622cf394f3cb2c7eb5f2c27072018baa (diff)
downloadforums-487fea8cfffe872e888ebcc3e1f5538b72bcaec1.tar
forums-487fea8cfffe872e888ebcc3e1f5538b72bcaec1.tar.gz
forums-487fea8cfffe872e888ebcc3e1f5538b72bcaec1.tar.bz2
forums-487fea8cfffe872e888ebcc3e1f5538b72bcaec1.tar.xz
forums-487fea8cfffe872e888ebcc3e1f5538b72bcaec1.zip
[ticket/12692] Move the language strings to cli.php
PHPBB3-12692
-rw-r--r--phpBB/config/default/container/services_console.yml4
-rw-r--r--phpBB/language/en/cli.php13
-rw-r--r--phpBB/phpbb/console/command/thumbnail/delete.php16
-rw-r--r--phpBB/phpbb/console/command/thumbnail/generate.php19
-rw-r--r--phpBB/phpbb/console/command/thumbnail/recreate.php14
-rw-r--r--tests/console/thumbnail_test.php4
6 files changed, 31 insertions, 39 deletions
diff --git a/phpBB/config/default/container/services_console.yml b/phpBB/config/default/container/services_console.yml
index 15f597520c..010bde025d 100644
--- a/phpBB/config/default/container/services_console.yml
+++ b/phpBB/config/default/container/services_console.yml
@@ -160,8 +160,8 @@ services:
console.command.thumbnail.generate:
class: phpbb\console\command\thumbnail\generate
arguments:
- - @dbal.conn
- @user
+ - @dbal.conn
- @cache
- %core.root_path%
- %core.php_ext%
@@ -178,8 +178,8 @@ services:
console.command.thumbnail.delete:
class: phpbb\console\command\thumbnail\delete
arguments:
- - @dbal.conn
- @user
+ - @dbal.conn
- %core.root_path%
tags:
- { name: console.command }
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php
index d45c52ac5d..f0e5dd6120 100644
--- a/phpBB/language/en/cli.php
+++ b/phpBB/language/en/cli.php
@@ -72,6 +72,10 @@ $lang = array_merge($lang, array(
'CLI_DESCRIPTION_SET_ATOMIC_CONFIG' => 'Sets a configuration option’s value only if the old matches the current value',
'CLI_DESCRIPTION_SET_CONFIG' => 'Sets a configuration option’s value',
+ 'CLI_DESCRIPTION_THUMBNAIL_DELETE' => 'Delete all existing thumbnails.',
+ 'CLI_DESCRIPTION_THUMBNAIL_GENERATE' => 'Generate all missing thumbnails.',
+ 'CLI_DESCRIPTION_THUMBNAIL_RECREATE' => 'Recreate all thumbnails.',
+
'CLI_EXTENSION_DISABLE_FAILURE' => 'Could not disable extension %s',
'CLI_EXTENSION_DISABLE_SUCCESS' => 'Successfully disabled extension %s',
'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s',
@@ -80,13 +84,16 @@ $lang = array_merge($lang, array(
'CLI_EXTENSION_PURGE_FAILURE' => 'Could not purge extension %s',
'CLI_EXTENSION_PURGE_SUCCESS' => 'Successfully purged extension %s',
'CLI_EXTENSION_NOT_FOUND' => 'No extensions were found.',
- 'CLI_EXTENSIONS_AVAILABLE' => 'Available',
- 'CLI_EXTENSIONS_DISABLED' => 'Disabled',
- 'CLI_EXTENSIONS_ENABLED' => 'Enabled',
'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.',
'CLI_REPARSER_REPARSE_REPARSING' => 'Reparsing %1$s (range %2$d..%3$d)',
'CLI_REPARSER_REPARSE_REPARSING_START' => 'Reparsing %s...',
'CLI_REPARSER_REPARSE_SUCCESS' => 'Reparsing ended with success',
+
+ // In all the case %1$s is the logical name of the file and %2$s the real name on the filesystem
+ // eg: big_image.png (2_a51529ae7932008cf8454a95af84cacd) generated.
+ 'THUMBNAIL_DELETED' => '%1$s (%2$s) deleted.',
+ 'THUMBNAIL_SKIPPED' => '%1$s (%2$s) skipped.',
+ 'THUMBNAIL_GENERATED' => '%1$s (%2$s) generated.',
));
diff --git a/phpBB/phpbb/console/command/thumbnail/delete.php b/phpBB/phpbb/console/command/thumbnail/delete.php
index 7c66011d5c..b60ea5238f 100644
--- a/phpBB/phpbb/console/command/thumbnail/delete.php
+++ b/phpBB/phpbb/console/command/thumbnail/delete.php
@@ -13,17 +13,15 @@
namespace phpbb\console\command\thumbnail;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;
class delete extends \phpbb\console\command\command
{
- /** @var \phpbb\db\driver\driver_interface */
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
protected $db;
- /** @var \phpbb\user */
- protected $user;
-
/**
* phpBB root path
* @var string
@@ -33,16 +31,16 @@ class delete extends \phpbb\console\command\command
/**
* Constructor
*
- * @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\user $user The user object (used to get language information)
+ * @param \phpbb\db\driver\driver_interface $db Database connection
* @param string $phpbb_root_path Root path
*/
- public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path)
+ public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path)
{
$this->db = $db;
- $this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
- parent::__construct();
+
+ parent::__construct($user);
}
/**
diff --git a/phpBB/phpbb/console/command/thumbnail/generate.php b/phpBB/phpbb/console/command/thumbnail/generate.php
index c27d91d4d5..640d971b5d 100644
--- a/phpBB/phpbb/console/command/thumbnail/generate.php
+++ b/phpBB/phpbb/console/command/thumbnail/generate.php
@@ -17,13 +17,14 @@ use Symfony\Component\Console\Output\OutputInterface;
class generate extends \phpbb\console\command\command
{
- /** @var \phpbb\db\driver\driver_interface */
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
protected $db;
- /** @var \phpbb\user */
- protected $user;
-
- /** @var \phpbb\cache\service */
+ /**
+ * @var \phpbb\cache\service
+ */
protected $cache;
/**
@@ -42,20 +43,20 @@ class generate extends \phpbb\console\command\command
/**
* Constructor
*
- * @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\user $user The user object (used to get language information)
+ * @param \phpbb\db\driver\driver_interface $db Database connection
* @param \phpbb\cache\service $cache The cache service
* @param string $phpbb_root_path Root path
* @param string $php_ext PHP extension
*/
- public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\cache\service $cache, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $phpbb_root_path, $php_ext)
{
$this->db = $db;
- $this->user = $user;
$this->cache = $cache;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
- parent::__construct();
+
+ parent::__construct($user);
}
/**
diff --git a/phpBB/phpbb/console/command/thumbnail/recreate.php b/phpBB/phpbb/console/command/thumbnail/recreate.php
index dd10da9106..624e4e507f 100644
--- a/phpBB/phpbb/console/command/thumbnail/recreate.php
+++ b/phpBB/phpbb/console/command/thumbnail/recreate.php
@@ -18,20 +18,6 @@ use Symfony\Component\Console\Output\OutputInterface;
class recreate extends \phpbb\console\command\command
{
- /** @var \phpbb\user */
- protected $user;
-
- /**
- * Constructor
- *
- * @param \phpbb\user $user The user object (used to get language information)
- */
- public function __construct(\phpbb\user $user)
- {
- $this->user = $user;
- parent::__construct();
- }
-
/**
* Sets the command name and description
*
diff --git a/tests/console/thumbnail_test.php b/tests/console/thumbnail_test.php
index 7ac18d931a..11d2717f73 100644
--- a/tests/console/thumbnail_test.php
+++ b/tests/console/thumbnail_test.php
@@ -56,8 +56,8 @@ class phpbb_console_command_thumbnail_test extends phpbb_database_test_case
)));
$this->application = new Application();
- $this->application->add(new generate($this->db, $this->user, $this->cache, $this->phpbb_root_path, $this->phpEx));
- $this->application->add(new delete($this->db, $this->user, $this->phpbb_root_path));
+ $this->application->add(new generate($this->user, $this->db, $this->cache, $this->phpbb_root_path, $this->phpEx));
+ $this->application->add(new delete($this->user, $this->db, $this->phpbb_root_path));
$this->application->add(new recreate($this->user));
}