From 56d7c2c6ed3e5924aeced53a163bfd1aa8288034 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Tue, 14 Oct 2014 17:58:29 +0200 Subject: [ticket/13126] Improve the feedback when running the migrations PHPBB3-13126 --- phpBB/phpbb/console/command/db/migrate.php | 56 +++++++++++++----------------- phpBB/phpbb/db/migrator.php | 51 +++++++++++++++++++++++++++ phpBB/phpbb/db/migrator_output_handler.php | 55 +++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+), 32 deletions(-) create mode 100644 phpBB/phpbb/db/migrator_output_handler.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php index c760cde5b5..ecb84d7401 100644 --- a/phpBB/phpbb/console/command/db/migrate.php +++ b/phpBB/phpbb/console/command/db/migrate.php @@ -53,6 +53,30 @@ class migrate extends \phpbb\console\command\command protected function execute(InputInterface $input, OutputInterface $output) { + $user = $this->user; + $this->migrator->set_output_handler( + new \phpbb\db\migrator_output_handler( + function($message, $verbosity) use ($output, $user) + { + if ($verbosity <= $output->getVerbosity()) + { + $final_message = call_user_func_array(array($user, 'lang'), $message); + + if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_NORMAL) + { + $final_message = '' . $final_message . ''; + } + else if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_VERY_VERBOSE) + { + $final_message = '' . $final_message . ''; + } + + $output->writeln($final_message); + } + } + ) + ); + $this->migrator->create_migrations_table(); $this->cache->purge(); @@ -61,8 +85,6 @@ class migrate extends \phpbb\console\command\command $orig_version = $this->config['version']; while (!$this->migrator->finished()) { - $migration_start_time = microtime(true); - try { $this->migrator->update(); @@ -73,36 +95,6 @@ class migrate extends \phpbb\console\command\command $this->finalise_update(); return 1; } - - $migration_stop_time = microtime(true) - $migration_start_time; - - $state = array_merge( - array( - 'migration_schema_done' => false, - 'migration_data_done' => false, - ), - $this->migrator->last_run_migration['state'] - ); - - if (!empty($this->migrator->last_run_migration['effectively_installed'])) - { - $msg = $this->user->lang('MIGRATION_EFFECTIVELY_INSTALLED', $this->migrator->last_run_migration['name']); - $output->writeln("$msg"); - } - else if ($this->migrator->last_run_migration['task'] == 'process_data_step' && $state['migration_data_done']) - { - $msg = $this->user->lang('MIGRATION_DATA_DONE', $this->migrator->last_run_migration['name'], $migration_stop_time); - $output->writeln("$msg"); - } - else if ($this->migrator->last_run_migration['task'] == 'process_data_step') - { - $output->writeln($this->user->lang('MIGRATION_DATA_IN_PROGRESS', $this->migrator->last_run_migration['name'], $migration_stop_time)); - } - else if ($state['migration_schema_done']) - { - $msg = $this->user->lang('MIGRATION_SCHEMA_DONE', $this->migrator->last_run_migration['name'], $migration_stop_time); - $output->writeln("$msg"); - } } if ($orig_version != $this->config['version']) diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 44bea3c5d2..9d9ad4f409 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -67,6 +67,13 @@ class migrator */ public $last_run_migration = false; + /** + * The output handler. A null handler is configured by default. + * + * @var migrator_output_handler + */ + public $output_handler; + /** * Constructor of the database migrator */ @@ -84,6 +91,8 @@ class migrator $this->table_prefix = $table_prefix; + $this->output_handler = new migrator_output_handler(); + foreach ($tools as $tool) { $this->tools[$tool->get_name()] = $tool; @@ -94,6 +103,16 @@ class migrator $this->load_migration_state(); } + /** + * Set the output handler. + * + * @param migrator_output_handler $handler The output handler + */ + public function set_output_handler(migrator_output_handler $handler) + { + $this->output_handler = $handler; + } + /** * Loads all migrations and their application state from the database. * @@ -161,6 +180,10 @@ class migrator return; } } + else + { + $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_DEBUG); + } } } @@ -175,6 +198,7 @@ class migrator { if (!class_exists($name)) { + $this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler::VERBOSITY_DEBUG); return false; } @@ -191,6 +215,11 @@ class migrator 'migration_end_time' => 0, ); + if (!empty($state['migration_depends_on'])) + { + $this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler::VERBOSITY_DEBUG); + } + foreach ($state['migration_depends_on'] as $depend) { if ($this->unfulfillable($depend) !== false) @@ -227,6 +256,8 @@ class migrator ); $this->last_run_migration['effectively_installed'] = true; + + $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_NORMAL); } else { @@ -238,23 +269,43 @@ class migrator if (!$state['migration_schema_done']) { + $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERY_VERBOSE); + $this->last_run_migration['task'] = 'process_schema_step'; + $elapsed_time = microtime(true); $steps = $this->helper->get_schema_steps($migration->update_schema()); $result = $this->process_data_step($steps, $state['migration_data_state']); + $elapsed_time = microtime(true) - $elapsed_time; $state['migration_data_state'] = ($result === true) ? '' : $result; $state['migration_schema_done'] = ($result === true); + + $this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler::VERBOSITY_NORMAL); } else if (!$state['migration_data_done']) { try { + $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERY_VERBOSE); + $this->last_run_migration['task'] = 'process_data_step'; + + $elapsed_time = microtime(true); $result = $this->process_data_step($migration->update_data(), $state['migration_data_state']); + $elapsed_time = microtime(true) - $elapsed_time; $state['migration_data_state'] = ($result === true) ? '' : $result; $state['migration_data_done'] = ($result === true); $state['migration_end_time'] = ($result === true) ? time() : 0; + + if ($state['migration_schema_done']) + { + $this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $elapsed_time), migrator_output_handler::VERBOSITY_NORMAL); + } + else + { + $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler::VERBOSITY_VERBOSE); + } } catch (\phpbb\db\migration\exception $e) { diff --git a/phpBB/phpbb/db/migrator_output_handler.php b/phpBB/phpbb/db/migrator_output_handler.php new file mode 100644 index 0000000000..5e011bc45b --- /dev/null +++ b/phpBB/phpbb/db/migrator_output_handler.php @@ -0,0 +1,55 @@ + +* @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; + +class migrator_output_handler +{ + const VERBOSITY_QUIET = 0; + const VERBOSITY_NORMAL = 1; + const VERBOSITY_VERBOSE = 2; + const VERBOSITY_VERY_VERBOSE = 3; + const VERBOSITY_DEBUG = 4; + + /** + * A callable used to write the output. + * + * @var callable + */ + private $closure; + + /** + * Constructor + * + * @param callable $closure The closure used to write the output. (null by default) + */ + public function __construct(\Closure $closure = null) + { + if ($closure === null) { + $closure = function($message, $verbosity) {}; + } + $this->closure = $closure; + } + + /** + * Write output using the configured closure. + * + * @param string|array $message The message to write or an array containing the language key and all of its parameters. + * @param int $verbosity The verbosity of the message. + */ + public function write($message, $verbosity) + { + $closure = $this->closure; + $closure((array) $message, $verbosity); + } +} -- cgit v1.2.1 From 58075e25e8173ec663e4e8908d1963b1947a225b Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 16 Oct 2014 01:34:23 +0200 Subject: [ticket/13126] Extends migrator_output_handler instead of using a closure PHPBB3-13126 --- .../command/db/console_migrator_output_handler.php | 72 ++++++++++++++++++++++ phpBB/phpbb/console/command/db/migrate.php | 24 +------- phpBB/phpbb/db/html_migrator_output_handler.php | 51 +++++++++++++++ phpBB/phpbb/db/migrator_output_handler.php | 22 ------- 4 files changed, 124 insertions(+), 45 deletions(-) create mode 100644 phpBB/phpbb/console/command/db/console_migrator_output_handler.php create mode 100644 phpBB/phpbb/db/html_migrator_output_handler.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php new file mode 100644 index 0000000000..be6c2ccd7a --- /dev/null +++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php @@ -0,0 +1,72 @@ + +* @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\console\command\db; + +use phpbb\user; +use phpbb\db\migrator_output_handler; +use Symfony\Component\Console\Output\OutputInterface; + +class console_migrator_output_handler extends migrator_output_handler +{ + /** + * User object. + * + * @var user + */ + private $user; + + /** + * Console output object. + * + * @var OutputInterface + */ + private $output; + + /** + * Constructor + * + * @param user $user User object + * @param OutputInterface $output Console output object + */ + public function __construct(user $user, OutputInterface $output) + { + $this->user = $user; + $this->output = $output; + } + + /** + * Write output using the configured closure. + * + * @param string|array $message The message to write or an array containing the language key and all of its parameters. + * @param int $verbosity The verbosity of the message. + */ + public function write($message, $verbosity) + { + if ($verbosity <= $this->output->getVerbosity()) + { + $translated_message = call_user_func_array(array($this->user, 'lang'), $message); + + if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_NORMAL) + { + $translated_message = '' . $translated_message . ''; + } + else if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_VERY_VERBOSE) + { + $translated_message = '' . $translated_message . ''; + } + + $this->output->writeln($translated_message); + } + } +} diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php index ecb84d7401..9d4b4a0c4d 100644 --- a/phpBB/phpbb/console/command/db/migrate.php +++ b/phpBB/phpbb/console/command/db/migrate.php @@ -53,29 +53,7 @@ class migrate extends \phpbb\console\command\command protected function execute(InputInterface $input, OutputInterface $output) { - $user = $this->user; - $this->migrator->set_output_handler( - new \phpbb\db\migrator_output_handler( - function($message, $verbosity) use ($output, $user) - { - if ($verbosity <= $output->getVerbosity()) - { - $final_message = call_user_func_array(array($user, 'lang'), $message); - - if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_NORMAL) - { - $final_message = '' . $final_message . ''; - } - else if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_VERY_VERBOSE) - { - $final_message = '' . $final_message . ''; - } - - $output->writeln($final_message); - } - } - ) - ); + $this->migrator->set_output_handler(new console_migrator_output_handler($this->user, $output)); $this->migrator->create_migrations_table(); diff --git a/phpBB/phpbb/db/html_migrator_output_handler.php b/phpBB/phpbb/db/html_migrator_output_handler.php new file mode 100644 index 0000000000..6812498f1f --- /dev/null +++ b/phpBB/phpbb/db/html_migrator_output_handler.php @@ -0,0 +1,51 @@ + +* @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; + +use phpbb\user; + +class html_migrator_output_handler extends migrator_output_handler +{ + /** + * User object. + * + * @var user + */ + private $user; + + /** + * Constructor + * + * @param user $user User object + */ + public function __construct(user $user) + { + $this->user = $user; + } + + /** + * Write output using the configured closure. + * + * @param string|array $message The message to write or an array containing the language key and all of its parameters. + * @param int $verbosity The verbosity of the message. + */ + public function write($message, $verbosity) + { + if ($verbosity <= migrator_output_handler::VERBOSITY_NORMAL) + { + $final_message = call_user_func_array(array($this->user, 'lang'), $message); + echo $final_message . "
\n"; + } + } +} diff --git a/phpBB/phpbb/db/migrator_output_handler.php b/phpBB/phpbb/db/migrator_output_handler.php index 5e011bc45b..14d5b7890a 100644 --- a/phpBB/phpbb/db/migrator_output_handler.php +++ b/phpBB/phpbb/db/migrator_output_handler.php @@ -21,26 +21,6 @@ class migrator_output_handler const VERBOSITY_VERY_VERBOSE = 3; const VERBOSITY_DEBUG = 4; - /** - * A callable used to write the output. - * - * @var callable - */ - private $closure; - - /** - * Constructor - * - * @param callable $closure The closure used to write the output. (null by default) - */ - public function __construct(\Closure $closure = null) - { - if ($closure === null) { - $closure = function($message, $verbosity) {}; - } - $this->closure = $closure; - } - /** * Write output using the configured closure. * @@ -49,7 +29,5 @@ class migrator_output_handler */ public function write($message, $verbosity) { - $closure = $this->closure; - $closure((array) $message, $verbosity); } } -- cgit v1.2.1 From 8f6fcd2744a80795139600c2a7c1f46f59b8cbfe Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 20 Oct 2014 19:38:04 +0200 Subject: [ticket/13126] Move migrator_output_handler to an interface PHPBB3-13126 --- .../command/db/console_migrator_output_handler.php | 11 +++----- phpBB/phpbb/db/html_migrator_output_handler.php | 9 ++---- .../db/migration/null_migrator_output_handler.php | 24 ++++++++++++++++ phpBB/phpbb/db/migrator_output_handler.php | 33 ---------------------- .../phpbb/db/migrator_output_handler_interface.php | 31 ++++++++++++++++++++ 5 files changed, 62 insertions(+), 46 deletions(-) create mode 100644 phpBB/phpbb/db/migration/null_migrator_output_handler.php delete mode 100644 phpBB/phpbb/db/migrator_output_handler.php create mode 100644 phpBB/phpbb/db/migrator_output_handler_interface.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php index be6c2ccd7a..0c494cea63 100644 --- a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php +++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php @@ -17,7 +17,7 @@ use phpbb\user; use phpbb\db\migrator_output_handler; use Symfony\Component\Console\Output\OutputInterface; -class console_migrator_output_handler extends migrator_output_handler +class console_migrator_output_handler implements migrator_output_handler_interface { /** * User object. @@ -46,10 +46,7 @@ class console_migrator_output_handler extends migrator_output_handler } /** - * Write output using the configured closure. - * - * @param string|array $message The message to write or an array containing the language key and all of its parameters. - * @param int $verbosity The verbosity of the message. + * {@inheritdoc} */ public function write($message, $verbosity) { @@ -57,11 +54,11 @@ class console_migrator_output_handler extends migrator_output_handler { $translated_message = call_user_func_array(array($this->user, 'lang'), $message); - if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_NORMAL) + if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL) { $translated_message = '' . $translated_message . ''; } - else if ($verbosity === \phpbb\db\migrator_output_handler::VERBOSITY_VERY_VERBOSE) + else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE) { $translated_message = '' . $translated_message . ''; } diff --git a/phpBB/phpbb/db/html_migrator_output_handler.php b/phpBB/phpbb/db/html_migrator_output_handler.php index 6812498f1f..82b7b416e2 100644 --- a/phpBB/phpbb/db/html_migrator_output_handler.php +++ b/phpBB/phpbb/db/html_migrator_output_handler.php @@ -15,7 +15,7 @@ namespace phpbb\db; use phpbb\user; -class html_migrator_output_handler extends migrator_output_handler +class html_migrator_output_handler implements migrator_output_handler_interface { /** * User object. @@ -35,14 +35,11 @@ class html_migrator_output_handler extends migrator_output_handler } /** - * Write output using the configured closure. - * - * @param string|array $message The message to write or an array containing the language key and all of its parameters. - * @param int $verbosity The verbosity of the message. + * {@inheritdoc} */ public function write($message, $verbosity) { - if ($verbosity <= migrator_output_handler::VERBOSITY_NORMAL) + if ($verbosity <= migrator_output_handler_interface::VERBOSITY_NORMAL) { $final_message = call_user_func_array(array($this->user, 'lang'), $message); echo $final_message . "
\n"; diff --git a/phpBB/phpbb/db/migration/null_migrator_output_handler.php b/phpBB/phpbb/db/migration/null_migrator_output_handler.php new file mode 100644 index 0000000000..bb3aabed45 --- /dev/null +++ b/phpBB/phpbb/db/migration/null_migrator_output_handler.php @@ -0,0 +1,24 @@ + +* @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; + +class null_migrator_output_handler +{ + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + } +} diff --git a/phpBB/phpbb/db/migrator_output_handler.php b/phpBB/phpbb/db/migrator_output_handler.php deleted file mode 100644 index 14d5b7890a..0000000000 --- a/phpBB/phpbb/db/migrator_output_handler.php +++ /dev/null @@ -1,33 +0,0 @@ - -* @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; - -class migrator_output_handler -{ - const VERBOSITY_QUIET = 0; - const VERBOSITY_NORMAL = 1; - const VERBOSITY_VERBOSE = 2; - const VERBOSITY_VERY_VERBOSE = 3; - const VERBOSITY_DEBUG = 4; - - /** - * Write output using the configured closure. - * - * @param string|array $message The message to write or an array containing the language key and all of its parameters. - * @param int $verbosity The verbosity of the message. - */ - public function write($message, $verbosity) - { - } -} diff --git a/phpBB/phpbb/db/migrator_output_handler_interface.php b/phpBB/phpbb/db/migrator_output_handler_interface.php new file mode 100644 index 0000000000..a923af99f6 --- /dev/null +++ b/phpBB/phpbb/db/migrator_output_handler_interface.php @@ -0,0 +1,31 @@ + +* @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; + +interface migrator_output_handler_interface +{ + const VERBOSITY_QUIET = 0; + const VERBOSITY_NORMAL = 1; + const VERBOSITY_VERBOSE = 2; + const VERBOSITY_VERY_VERBOSE = 3; + const VERBOSITY_DEBUG = 4; + + /** + * Write output using the configured closure. + * + * @param string|array $message The message to write or an array containing the language key and all of its parameters. + * @param int $verbosity The verbosity of the message. + */ + public function write($message, $verbosity); +} -- cgit v1.2.1 From faf4b03c43ecac7aa16e42433cce591512f3ef90 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 20 Oct 2014 19:42:54 +0200 Subject: [ticket/13126] Change messages verbosity levels PHPBB3-13126 --- .../console/command/db/console_migrator_output_handler.php | 2 +- phpBB/phpbb/db/html_migrator_output_handler.php | 2 +- phpBB/phpbb/db/migrator.php | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php index 0c494cea63..74549e8e42 100644 --- a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php +++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php @@ -58,7 +58,7 @@ class console_migrator_output_handler implements migrator_output_handler_interfa { $translated_message = '' . $translated_message . ''; } - else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE) + else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE) { $translated_message = '' . $translated_message . ''; } diff --git a/phpBB/phpbb/db/html_migrator_output_handler.php b/phpBB/phpbb/db/html_migrator_output_handler.php index 82b7b416e2..e37c667463 100644 --- a/phpBB/phpbb/db/html_migrator_output_handler.php +++ b/phpBB/phpbb/db/html_migrator_output_handler.php @@ -39,7 +39,7 @@ class html_migrator_output_handler implements migrator_output_handler_interface */ public function write($message, $verbosity) { - if ($verbosity <= migrator_output_handler_interface::VERBOSITY_NORMAL) + if ($verbosity <= migrator_output_handler_interface::VERBOSITY_VERBOSE) { $final_message = call_user_func_array(array($this->user, 'lang'), $message); echo $final_message . "
\n"; diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index 9d9ad4f409..c2fa04eb44 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -91,7 +91,7 @@ class migrator $this->table_prefix = $table_prefix; - $this->output_handler = new migrator_output_handler(); + $this->output_handler = new null_migrator_output_handler(); foreach ($tools as $tool) { @@ -257,7 +257,7 @@ class migrator $this->last_run_migration['effectively_installed'] = true; - $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_NORMAL); + $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_VERBOSE); } else { @@ -269,7 +269,7 @@ class migrator if (!$state['migration_schema_done']) { - $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERY_VERBOSE); + $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERBOSE); $this->last_run_migration['task'] = 'process_schema_step'; $elapsed_time = microtime(true); @@ -286,7 +286,7 @@ class migrator { try { - $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERY_VERBOSE); + $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERBOSE); $this->last_run_migration['task'] = 'process_data_step'; @@ -304,7 +304,7 @@ class migrator } else { - $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler::VERBOSITY_VERBOSE); + $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler::VERBOSITY_VERY_VERBOSE); } } catch (\phpbb\db\migration\exception $e) -- cgit v1.2.1 From 981d3005f37d6298bd8775154e83194dbe0a0ed1 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 20 Oct 2014 19:59:36 +0200 Subject: [ticket/13126] Fix tests PHPBB3-13126 --- .../command/db/console_migrator_output_handler.php | 1 - .../db/migration/null_migrator_output_handler.php | 24 ---------------------- phpBB/phpbb/db/migrator.php | 20 +++++++++--------- phpBB/phpbb/db/null_migrator_output_handler.php | 24 ++++++++++++++++++++++ 4 files changed, 34 insertions(+), 35 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/null_migrator_output_handler.php create mode 100644 phpBB/phpbb/db/null_migrator_output_handler.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php index 74549e8e42..92a047605d 100644 --- a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php +++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php @@ -14,7 +14,6 @@ namespace phpbb\console\command\db; use phpbb\user; -use phpbb\db\migrator_output_handler; use Symfony\Component\Console\Output\OutputInterface; class console_migrator_output_handler implements migrator_output_handler_interface diff --git a/phpBB/phpbb/db/migration/null_migrator_output_handler.php b/phpBB/phpbb/db/migration/null_migrator_output_handler.php deleted file mode 100644 index bb3aabed45..0000000000 --- a/phpBB/phpbb/db/migration/null_migrator_output_handler.php +++ /dev/null @@ -1,24 +0,0 @@ - -* @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; - -class null_migrator_output_handler -{ - /** - * {@inheritdoc} - */ - public function write($message, $verbosity) - { - } -} diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index c2fa04eb44..621a808a03 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -108,7 +108,7 @@ class migrator * * @param migrator_output_handler $handler The output handler */ - public function set_output_handler(migrator_output_handler $handler) + public function set_output_handler(migrator_output_handler_interface $handler) { $this->output_handler = $handler; } @@ -182,7 +182,7 @@ class migrator } else { - $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_DEBUG); + $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_DEBUG); } } } @@ -198,7 +198,7 @@ class migrator { if (!class_exists($name)) { - $this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler::VERBOSITY_DEBUG); + $this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler_interface::VERBOSITY_DEBUG); return false; } @@ -217,7 +217,7 @@ class migrator if (!empty($state['migration_depends_on'])) { - $this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler::VERBOSITY_DEBUG); + $this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler_interface::VERBOSITY_DEBUG); } foreach ($state['migration_depends_on'] as $depend) @@ -257,7 +257,7 @@ class migrator $this->last_run_migration['effectively_installed'] = true; - $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler::VERBOSITY_VERBOSE); + $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE); } else { @@ -269,7 +269,7 @@ class migrator if (!$state['migration_schema_done']) { - $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERBOSE); + $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE); $this->last_run_migration['task'] = 'process_schema_step'; $elapsed_time = microtime(true); @@ -280,13 +280,13 @@ class migrator $state['migration_data_state'] = ($result === true) ? '' : $result; $state['migration_schema_done'] = ($result === true); - $this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler::VERBOSITY_NORMAL); + $this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL); } else if (!$state['migration_data_done']) { try { - $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler::VERBOSITY_VERBOSE); + $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE); $this->last_run_migration['task'] = 'process_data_step'; @@ -300,11 +300,11 @@ class migrator if ($state['migration_schema_done']) { - $this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $elapsed_time), migrator_output_handler::VERBOSITY_NORMAL); + $this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL); } else { - $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler::VERBOSITY_VERY_VERBOSE); + $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE); } } catch (\phpbb\db\migration\exception $e) diff --git a/phpBB/phpbb/db/null_migrator_output_handler.php b/phpBB/phpbb/db/null_migrator_output_handler.php new file mode 100644 index 0000000000..0e8cfbb049 --- /dev/null +++ b/phpBB/phpbb/db/null_migrator_output_handler.php @@ -0,0 +1,24 @@ + +* @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; + +class null_migrator_output_handler implements migrator_output_handler_interface +{ + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + } +} -- cgit v1.2.1 From fdece6cdf3cb375da1ee4ab488d2ec8d854845db Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 22 Oct 2014 15:25:50 +0200 Subject: [ticket/13126] Add missing use statement PHPBB3-13126 --- phpBB/phpbb/console/command/db/console_migrator_output_handler.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php index 92a047605d..b9741a3838 100644 --- a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php +++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php @@ -14,6 +14,7 @@ namespace phpbb\console\command\db; 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 -- cgit v1.2.1 From 516bd9ea51a2c2b908eb1f62bddaba967559db4a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 24 Oct 2014 13:20:40 -0700 Subject: [ticket/13211] Add log wrapper for writing database updater to log file PHPBB3-13211 --- .../db/log_wrapper_migrator_output_handler.php | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 phpBB/phpbb/db/log_wrapper_migrator_output_handler.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php new file mode 100644 index 0000000000..e81dfd7a62 --- /dev/null +++ b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php @@ -0,0 +1,95 @@ + +* @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; + +use phpbb\user; + +class log_wrapper_migrator_output_handler implements migrator_output_handler_interface +{ + /** + * User object. + * + * @var user + */ + protected $user; + + /** + * HTML migrator output handler + * + * @var html_migrator_output_handler + */ + protected $html_migrator; + + /** + * Log file handle + * @var resource + */ + protected $file_handle = false; + + /** + * Constructor + * + * @param user $user User object + * @param html_migrator_output_handler $html_migrator HTML migrator output handler + * @param string $log_file File to log to + */ + public function __construct(user $user, html_migrator_output_handler $html_migrator, $log_file) + { + $this->user = $user; + $this->html_migrator = $html_migrator; + $this->file_open($log_file); + } + + /** + * Open file for logging + * + * @param string $file File to open + */ + protected function file_open($file) + { + if (phpbb_is_writable(dirname($file))) + { + $this->file_handle = fopen($file, 'w'); + } + else + { + throw new \RuntimeException('Unable to write to migrator log file'); + } + } + + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + $this->html_migrator->write($message, $verbosity); + + if ($this->file_handle !== false) + { + $translated_message = call_user_func_array(array($this->user, 'lang'), $message) . "\n"; + + if ($verbosity <= migrator_output_handler_interface::VERBOSITY_NORMAL) + { + $translated_message = '[INFO] ' . $translated_message; + } + else + { + $translated_message = '[DEBUG] ' . $translated_message; + } + + fwrite($this->file_handle, $translated_message); + fflush($this->file_handle); + } + } +} -- cgit v1.2.1 From b27b9a6984f2ed3a9a186133657d30b4cca883c0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 24 Oct 2014 13:33:26 -0700 Subject: [ticket/13211] Move console migrator output handler to db folder PHPBB3-13211 --- .../command/db/console_migrator_output_handler.php | 69 ---------------------- phpBB/phpbb/console/command/db/migrate.php | 2 +- phpBB/phpbb/db/console_migrator_output_handler.php | 68 +++++++++++++++++++++ 3 files changed, 69 insertions(+), 70 deletions(-) delete mode 100644 phpBB/phpbb/console/command/db/console_migrator_output_handler.php create mode 100644 phpBB/phpbb/db/console_migrator_output_handler.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php deleted file mode 100644 index b9741a3838..0000000000 --- a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php +++ /dev/null @@ -1,69 +0,0 @@ - -* @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\console\command\db; - -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 -{ - /** - * User object. - * - * @var user - */ - private $user; - - /** - * Console output object. - * - * @var OutputInterface - */ - private $output; - - /** - * Constructor - * - * @param user $user User object - * @param OutputInterface $output Console output object - */ - public function __construct(user $user, OutputInterface $output) - { - $this->user = $user; - $this->output = $output; - } - - /** - * {@inheritdoc} - */ - public function write($message, $verbosity) - { - if ($verbosity <= $this->output->getVerbosity()) - { - $translated_message = call_user_func_array(array($this->user, 'lang'), $message); - - if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL) - { - $translated_message = '' . $translated_message . ''; - } - else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE) - { - $translated_message = '' . $translated_message . ''; - } - - $this->output->writeln($translated_message); - } - } -} diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php index 9d4b4a0c4d..15349e1230 100644 --- a/phpBB/phpbb/console/command/db/migrate.php +++ b/phpBB/phpbb/console/command/db/migrate.php @@ -53,7 +53,7 @@ class migrate extends \phpbb\console\command\command protected function execute(InputInterface $input, OutputInterface $output) { - $this->migrator->set_output_handler(new console_migrator_output_handler($this->user, $output)); + $this->migrator->set_output_handler(new \phpbb\db\console_migrator_output_handler($this->user, $output)); $this->migrator->create_migrations_table(); diff --git a/phpBB/phpbb/db/console_migrator_output_handler.php b/phpBB/phpbb/db/console_migrator_output_handler.php new file mode 100644 index 0000000000..6f98995403 --- /dev/null +++ b/phpBB/phpbb/db/console_migrator_output_handler.php @@ -0,0 +1,68 @@ + +* @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; + +use phpbb\user; +use Symfony\Component\Console\Output\OutputInterface; + +class console_migrator_output_handler implements migrator_output_handler_interface +{ + /** + * User object. + * + * @var user + */ + private $user; + + /** + * Console output object. + * + * @var OutputInterface + */ + private $output; + + /** + * Constructor + * + * @param user $user User object + * @param OutputInterface $output Console output object + */ + public function __construct(user $user, OutputInterface $output) + { + $this->user = $user; + $this->output = $output; + } + + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + if ($verbosity <= $this->output->getVerbosity()) + { + $translated_message = call_user_func_array(array($this->user, 'lang'), $message); + + if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL) + { + $translated_message = '' . $translated_message . ''; + } + else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE) + { + $translated_message = '' . $translated_message . ''; + } + + $this->output->writeln($translated_message); + } + } +} -- cgit v1.2.1 From 84434630065c2491cfa5e65a69b8b22d6844b6f4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 25 Oct 2014 11:55:15 -0700 Subject: [ticket/13211] Also use log wrapper output handler for console migrations PHPBB3-13211 --- phpBB/phpbb/console/command/db/migrate.php | 8 ++++++-- phpBB/phpbb/db/log_wrapper_migrator_output_handler.php | 14 +++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php index 15349e1230..76550a8429 100644 --- a/phpBB/phpbb/console/command/db/migrate.php +++ b/phpBB/phpbb/console/command/db/migrate.php @@ -32,13 +32,17 @@ class migrate extends \phpbb\console\command\command /** @var \phpbb\log\log */ protected $log; - 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) + /** @var string phpBB root path */ + protected $phpbb_root_path; + + 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_root_path) { $this->migrator = $migrator; $this->extension_manager = $extension_manager; $this->config = $config; $this->cache = $cache; $this->log = $log; + $this->phpbb_root_path = $phpbb_root_path; parent::__construct($user); $this->user->add_lang(array('common', 'install', 'migrator')); } @@ -53,7 +57,7 @@ class migrate extends \phpbb\console\command\command protected function execute(InputInterface $input, OutputInterface $output) { - $this->migrator->set_output_handler(new \phpbb\db\console_migrator_output_handler($this->user, $output)); + $this->migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($this->user, new \phpbb\db\console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log')); $this->migrator->create_migrations_table(); diff --git a/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php index e81dfd7a62..94c293dc45 100644 --- a/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php +++ b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php @@ -25,11 +25,11 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int protected $user; /** - * HTML migrator output handler + * A migrator output handler * - * @var html_migrator_output_handler + * @var migrator_output_handler_interface */ - protected $html_migrator; + protected $migrator; /** * Log file handle @@ -41,13 +41,13 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int * Constructor * * @param user $user User object - * @param html_migrator_output_handler $html_migrator HTML migrator output handler + * @param migrator_output_handler_interface $migrator Migrator output handler * @param string $log_file File to log to */ - public function __construct(user $user, html_migrator_output_handler $html_migrator, $log_file) + public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file) { $this->user = $user; - $this->html_migrator = $html_migrator; + $this->migrator = $migrator; $this->file_open($log_file); } @@ -73,7 +73,7 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int */ public function write($message, $verbosity) { - $this->html_migrator->write($message, $verbosity); + $this->migrator->write($message, $verbosity); if ($this->file_handle !== false) { -- cgit v1.2.1 From 078e0c1e440f7f906b670348e8da00141e245876 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 25 Oct 2014 12:03:13 -0700 Subject: [ticket/13211] Move console migrator output handler back to console folder PHPBB3-13211 --- .../command/db/console_migrator_output_handler.php | 69 ++++++++++++++++++++++ phpBB/phpbb/console/command/db/migrate.php | 2 +- phpBB/phpbb/db/console_migrator_output_handler.php | 68 --------------------- 3 files changed, 70 insertions(+), 69 deletions(-) create mode 100644 phpBB/phpbb/console/command/db/console_migrator_output_handler.php delete mode 100644 phpBB/phpbb/db/console_migrator_output_handler.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php new file mode 100644 index 0000000000..b9741a3838 --- /dev/null +++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php @@ -0,0 +1,69 @@ + +* @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\console\command\db; + +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 +{ + /** + * User object. + * + * @var user + */ + private $user; + + /** + * Console output object. + * + * @var OutputInterface + */ + private $output; + + /** + * Constructor + * + * @param user $user User object + * @param OutputInterface $output Console output object + */ + public function __construct(user $user, OutputInterface $output) + { + $this->user = $user; + $this->output = $output; + } + + /** + * {@inheritdoc} + */ + public function write($message, $verbosity) + { + if ($verbosity <= $this->output->getVerbosity()) + { + $translated_message = call_user_func_array(array($this->user, 'lang'), $message); + + if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL) + { + $translated_message = '' . $translated_message . ''; + } + else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE) + { + $translated_message = '' . $translated_message . ''; + } + + $this->output->writeln($translated_message); + } + } +} diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php index 76550a8429..87c2a057d1 100644 --- a/phpBB/phpbb/console/command/db/migrate.php +++ b/phpBB/phpbb/console/command/db/migrate.php @@ -57,7 +57,7 @@ class migrate extends \phpbb\console\command\command protected function execute(InputInterface $input, OutputInterface $output) { - $this->migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($this->user, new \phpbb\db\console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log')); + $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->migrator->create_migrations_table(); diff --git a/phpBB/phpbb/db/console_migrator_output_handler.php b/phpBB/phpbb/db/console_migrator_output_handler.php deleted file mode 100644 index 6f98995403..0000000000 --- a/phpBB/phpbb/db/console_migrator_output_handler.php +++ /dev/null @@ -1,68 +0,0 @@ - -* @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; - -use phpbb\user; -use Symfony\Component\Console\Output\OutputInterface; - -class console_migrator_output_handler implements migrator_output_handler_interface -{ - /** - * User object. - * - * @var user - */ - private $user; - - /** - * Console output object. - * - * @var OutputInterface - */ - private $output; - - /** - * Constructor - * - * @param user $user User object - * @param OutputInterface $output Console output object - */ - public function __construct(user $user, OutputInterface $output) - { - $this->user = $user; - $this->output = $output; - } - - /** - * {@inheritdoc} - */ - public function write($message, $verbosity) - { - if ($verbosity <= $this->output->getVerbosity()) - { - $translated_message = call_user_func_array(array($this->user, 'lang'), $message); - - if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL) - { - $translated_message = '' . $translated_message . ''; - } - else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE) - { - $translated_message = '' . $translated_message . ''; - } - - $this->output->writeln($translated_message); - } - } -} -- cgit v1.2.1