1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-18 22:41:28 +02:00

[ticket/16345] Small improvements

PHPBB3-16346
This commit is contained in:
rubencm
2020-06-07 02:15:35 +00:00
parent 3cceeb45bf
commit 774c609c4a
284 changed files with 1380 additions and 835 deletions

View File

@@ -46,7 +46,7 @@ class local_url_bbcode extends \phpbb\db\migration\migration
{
if (function_exists('phpbb_require_updated'))
{
phpbb_require_updated('includes/acp/acp_bbcodes.' . $this->php_ext);
phpbb_require_updated('includes/acp/acp_bbcodes.' . $this->php_ext, $this->phpbb_root_path);
}
else
{

View File

@@ -121,7 +121,7 @@ class release_3_0_4_rc1 extends \phpbb\db\migration\migration
$sql_ary['field_show_profile'] = 1;
}
$this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary);
$this->sql_query('UPDATE ' . $this->table_prefix . 'profile_fields SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id']);
}
$this->db->sql_freeresult($result);

View File

@@ -16,7 +16,7 @@ namespace phpbb\db\migration\data\v310;
class avatar_types extends \phpbb\db\migration\migration
{
/**
* @var avatar type map
* @var array avatar type map
*/
protected $avatar_type_map = array(
AVATAR_UPLOAD => 'avatar.driver.upload',

View File

@@ -54,6 +54,7 @@ class bot_update extends \phpbb\db\migration\migration
if (!$group_row)
{
// default fallback, should never get here
$group_row = [];
$group_row['group_id'] = 6;
$group_row['group_colour'] = '9E8DA7';
}

View File

@@ -122,7 +122,7 @@ class notification_options_reconvert extends \phpbb\db\migration\migration
* @param string $item_type
* @param int $item_id
* @param int $user_id
* @param string $methods
* @param array $methods
*/
protected function add_method_rows(\phpbb\db\sql_insert_buffer $insert_buffer, $item_type, $item_id, $user_id, array $methods)
{

View File

@@ -83,7 +83,7 @@ class style_update extends \phpbb\db\migration\migration
// Set prosilver to default style
$this->config->set('default_style', $style_id);
}
else if (empty($styles) && empty($available_styles))
else if (empty($styles) && empty($style_paths))
{
throw new \RuntimeException('No valid styles available');
}

View File

@@ -20,9 +20,6 @@ use phpbb\module\exception\module_exception;
*/
class module implements \phpbb\db\migration\tool\tool_interface
{
/** @var \phpbb\cache\service */
protected $cache;
/** @var \phpbb\db\driver\driver_interface */
protected $db;
@@ -32,12 +29,6 @@ class module implements \phpbb\db\migration\tool\tool_interface
/** @var \phpbb\module\module_manager */
protected $module_manager;
/** @var string */
protected $phpbb_root_path;
/** @var string */
protected $php_ext;
/** @var string */
protected $modules_table;
@@ -48,21 +39,15 @@ class module implements \phpbb\db\migration\tool\tool_interface
* Constructor
*
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\cache\service $cache
* @param \phpbb\user $user
* @param \phpbb\module\module_manager $module_manager
* @param string $phpbb_root_path
* @param string $php_ext
* @param string $modules_table
*/
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, \phpbb\module\module_manager $module_manager, $phpbb_root_path, $php_ext, $modules_table)
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\module\module_manager $module_manager, $modules_table)
{
$this->db = $db;
$this->cache = $cache;
$this->user = $user;
$this->module_manager = $module_manager;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->modules_table = $modules_table;
}

View File

@@ -115,9 +115,6 @@ class permission implements \phpbb\db\migration\tool\tool_interface
return;
}
// We've added permissions, so set to true to notify the user.
$this->permissions_added = true;
if (!class_exists('auth_admin'))
{
include($this->phpbb_root_path . 'includes/acp/auth.' . $this->php_ext);

View File

@@ -50,6 +50,9 @@ class migrator
/** @var array */
protected $tables;
/** @var array */
protected $tools;
/** @var string */
protected $phpbb_root_path;
@@ -87,7 +90,7 @@ class migrator
*
* 'effectively_installed' set and set to true if the migration was effectively_installed
*
* @var array
* @var array|bool
*/
protected $last_run_migration = false;
@@ -130,6 +133,7 @@ class migrator
$this->output_handler = new null_migrator_output_handler();
$this->tools = [];
foreach ($tools as $tool)
{
$this->tools[$tool->get_name()] = $tool;
@@ -699,7 +703,7 @@ class migrator
}
// Reverse the step that was run
$result = $this->run_step($reverse_step, false, !$revert);
$this->run_step($reverse_step, false, !$revert);
}
throw $e;

View File

@@ -31,7 +31,7 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
/**
* Log file handle
* @var resource
* @var resource|bool
*/
protected $file_handle = false;