1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

[ticket/14039] Revamp updater

PHPBB3-14039
This commit is contained in:
Mate Bartus
2015-07-24 09:20:50 +02:00
parent f1047ac854
commit 8f5a0ad6f7
94 changed files with 4514 additions and 263 deletions

View File

@@ -13,6 +13,8 @@
namespace phpbb\db;
use phpbb\db\output_handler\migrator_output_handler_interface;
use phpbb\db\output_handler\null_migrator_output_handler;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -122,7 +124,7 @@ class migrator
/**
* Set the output handler.
*
* @param migrator_output_handler $handler The output handler
* @param migrator_output_handler_interface $handler The output handler
*/
public function set_output_handler(migrator_output_handler_interface $handler)
{

View File

@@ -11,27 +11,25 @@
*
*/
namespace phpbb\db;
use phpbb\user;
namespace phpbb\db\output_handler;
class html_migrator_output_handler implements migrator_output_handler_interface
{
/**
* User object.
* Language object.
*
* @var user
* @var \phpbb\language\language
*/
private $user;
private $language;
/**
* Constructor
*
* @param user $user User object
* @param \phpbb\language\language $language Language object
*/
public function __construct(user $user)
public function __construct(\phpbb\language\language $language)
{
$this->user = $user;
$this->language = $language;
}
/**
@@ -41,7 +39,7 @@ class html_migrator_output_handler implements migrator_output_handler_interface
{
if ($verbosity <= migrator_output_handler_interface::VERBOSITY_VERBOSE)
{
$final_message = call_user_func_array(array($this->user, 'lang'), $message);
$final_message = $this->language->lang_array($message);
echo $final_message . "<br />\n";
}
}

View File

@@ -0,0 +1,46 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\output_handler;
use phpbb\install\helper\iohandler\iohandler_interface;
class installer_migrator_output_handler implements migrator_output_handler_interface
{
/**
* @var iohandler_interface
*/
protected $iohandler;
/**
* Constructor
*
* @param iohandler_interface $iohandler Installer's IO-handler
*/
public function __construct(iohandler_interface $iohandler)
{
$this->iohandler = $iohandler;
}
/**
* {@inheritdoc}
*/
public function write($message, $verbosity)
{
if ($verbosity <= migrator_output_handler_interface::VERBOSITY_VERBOSE)
{
$this->iohandler->add_log_message($message);
$this->iohandler->send_response();
}
}
}

View File

@@ -11,18 +11,16 @@
*
*/
namespace phpbb\db;
use phpbb\user;
namespace phpbb\db\output_handler;
class log_wrapper_migrator_output_handler implements migrator_output_handler_interface
{
/**
* User object.
* Language object.
*
* @var user
* @var \phpbb\language\language
*/
protected $user;
protected $language;
/**
* A migrator output handler
@@ -45,14 +43,14 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
/**
* Constructor
*
* @param user $user User object
* @param migrator_output_handler_interface $migrator Migrator output handler
* @param string $log_file File to log to
* @param \phpbb\filesystem\filesystem_interface phpBB filesystem object
* @param \phpbb\language\language $language Language object
* @param migrator_output_handler_interface $migrator Migrator output handler
* @param string $log_file File to log to
* @param \phpbb\filesystem\filesystem_interface $filesystem phpBB filesystem object
*/
public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file, \phpbb\filesystem\filesystem_interface $filesystem)
public function __construct(\phpbb\language\language $language, migrator_output_handler_interface $migrator, $log_file, \phpbb\filesystem\filesystem_interface $filesystem)
{
$this->user = $user;
$this->language = $language;
$this->migrator = $migrator;
$this->filesystem = $filesystem;
$this->file_open($log_file);
@@ -84,7 +82,7 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
if ($this->file_handle !== false)
{
$translated_message = call_user_func_array(array($this->user, 'lang'), $message) . "\n";
$translated_message = $this->language->lang_array($message);
if ($verbosity <= migrator_output_handler_interface::VERBOSITY_NORMAL)
{

View File

@@ -11,7 +11,7 @@
*
*/
namespace phpbb\db;
namespace phpbb\db\output_handler;
interface migrator_output_handler_interface
{

View File

@@ -11,7 +11,7 @@
*
*/
namespace phpbb\db;
namespace phpbb\db\output_handler;
class null_migrator_output_handler implements migrator_output_handler_interface
{