aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console/command/db/migrate.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2016-12-11 20:25:09 +0100
committerTristan Darricau <github@nicofuma.fr>2016-12-11 20:25:09 +0100
commit8c9d6add2ea20a2845eb1137be1607dfd00378c6 (patch)
treee63713beca201aebcf77faa1e827f4be59364ba2 /phpBB/phpbb/console/command/db/migrate.php
parent0cf85c047e848a75df236c4617b449498627dccc (diff)
parent6a5b99b12b1812202843613994480cc6caf93354 (diff)
downloadforums-8c9d6add2ea20a2845eb1137be1607dfd00378c6.tar
forums-8c9d6add2ea20a2845eb1137be1607dfd00378c6.tar.gz
forums-8c9d6add2ea20a2845eb1137be1607dfd00378c6.tar.bz2
forums-8c9d6add2ea20a2845eb1137be1607dfd00378c6.tar.xz
forums-8c9d6add2ea20a2845eb1137be1607dfd00378c6.zip
Merge pull request #4564 from VSEphpbb/ticket/14895
[ticket/14895] CLI should use SymfonyStyle * VSEphpbb/ticket/14895: [ticket/14895] Fix broken tests [ticket/14895] Fix issues in CLI classes [ticket/14895] Use SymfonyStyle in all CLI [ticket/14895] Use SymfonyIO styling [ticket/14895] CLI reparser:list should display proper list
Diffstat (limited to 'phpBB/phpbb/console/command/db/migrate.php')
-rw-r--r--phpBB/phpbb/console/command/db/migrate.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php
index ae4211f7be..4270e2d703 100644
--- a/phpBB/phpbb/console/command/db/migrate.php
+++ b/phpBB/phpbb/console/command/db/migrate.php
@@ -15,6 +15,7 @@ namespace phpbb\console\command\db;
use phpbb\db\output_handler\log_wrapper_migrator_output_handler;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
class migrate extends \phpbb\console\command\db\migration_command
{
@@ -30,26 +31,28 @@ class migrate extends \phpbb\console\command\db\migration_command
/** @var \phpbb\language\language */
protected $language;
- function __construct(\phpbb\user $user, \phpbb\language\language $language, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
+ public function __construct(\phpbb\user $user, \phpbb\language\language $language, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
{
$this->language = $language;
$this->log = $log;
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
parent::__construct($user, $migrator, $extension_manager, $config, $cache);
- $this->user->add_lang(array('common', 'install', 'migrator'));
+ $this->language->add_lang(array('common', 'install', 'migrator'));
}
protected function configure()
{
$this
->setName('db:migrate')
- ->setDescription($this->user->lang('CLI_DESCRIPTION_DB_MIGRATE'))
+ ->setDescription($this->language->lang('CLI_DESCRIPTION_DB_MIGRATE'))
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
+ $io = new SymfonyStyle($input, $output);
+
$this->migrator->set_output_handler(new log_wrapper_migrator_output_handler($this->language, new console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log', $this->filesystem));
$this->migrator->create_migrations_table();
@@ -66,7 +69,7 @@ class migrate extends \phpbb\console\command\db\migration_command
}
catch (\phpbb\db\migration\exception $e)
{
- $output->writeln('<error>' . $e->getLocalisedMessage($this->user) . '</error>');
+ $io->error($e->getLocalisedMessage($this->user));
$this->finalise_update();
return 1;
}
@@ -78,6 +81,6 @@ class migrate extends \phpbb\console\command\db\migration_command
}
$this->finalise_update();
- $output->writeln($this->user->lang['DATABASE_UPDATE_COMPLETE']);
+ $io->success($this->language->lang('INLINE_UPDATE_SUCCESSFUL'));
}
}