mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
[ticket/14039] Revamp updater
PHPBB3-14039
This commit is contained in:
@@ -13,8 +13,8 @@
|
||||
|
||||
namespace phpbb\console\command\db;
|
||||
|
||||
use phpbb\db\output_handler\migrator_output_handler_interface;
|
||||
use phpbb\user;
|
||||
use phpbb\db\migrator_output_handler_interface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class console_migrator_output_handler implements migrator_output_handler_interface
|
||||
|
@@ -12,6 +12,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;
|
||||
|
||||
@@ -26,8 +27,12 @@ class migrate extends \phpbb\console\command\db\migration_command
|
||||
/** @var \phpbb\filesystem\filesystem_interface */
|
||||
protected $filesystem;
|
||||
|
||||
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, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
|
||||
/** @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)
|
||||
{
|
||||
$this->language = $language;
|
||||
$this->log = $log;
|
||||
$this->filesystem = $filesystem;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
@@ -45,7 +50,7 @@ class migrate extends \phpbb\console\command\db\migration_command
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($this->user, new console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log', $this->filesystem));
|
||||
$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();
|
||||
|
||||
|
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
namespace phpbb\console\command\db;
|
||||
|
||||
use phpbb\db\output_handler\log_wrapper_migrator_output_handler;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
@@ -24,9 +25,13 @@ class revert extends \phpbb\console\command\db\migration_command
|
||||
/** @var \phpbb\filesystem\filesystem_interface */
|
||||
protected $filesystem;
|
||||
|
||||
function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
|
||||
/** @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\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
|
||||
{
|
||||
$this->filesystem = $filesystem;
|
||||
$this->language = $language;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
parent::__construct($user, $migrator, $extension_manager, $config, $cache);
|
||||
$this->user->add_lang(array('common', 'migrator'));
|
||||
@@ -49,7 +54,7 @@ class revert extends \phpbb\console\command\db\migration_command
|
||||
{
|
||||
$name = str_replace('/', '\\', $input->getArgument('name'));
|
||||
|
||||
$this->migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($this->user, new console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log', $this->filesystem));
|
||||
$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->cache->purge();
|
||||
|
||||
|
Reference in New Issue
Block a user