mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
- adjust db_tools again to not remove any schema (they may be required)
- fill dbms version if not yet filled git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9351 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
bfa4e6038e
commit
62973fa504
4 changed files with 26 additions and 35 deletions
|
@ -510,6 +510,12 @@ class acp_main
|
|||
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
|
||||
}
|
||||
|
||||
// Fill dbms version if not yet filled
|
||||
if (empty($config['dbms_version']))
|
||||
{
|
||||
set_config('dbms_version', $db->sql_server_info(true));
|
||||
}
|
||||
|
||||
$this->tpl_name = 'acp_main';
|
||||
$this->page_title = 'ACP_MAIN';
|
||||
}
|
||||
|
|
|
@ -311,9 +311,6 @@ class phpbb_db_tools
|
|||
$this->sql_layer = $this->db->sql_layer;
|
||||
break;
|
||||
}
|
||||
|
||||
// Because we only need the dbms type map of one database type, we "adjust" it now. ;)
|
||||
$this->dbms_type_map = $this->dbms_type_map[$this->sql_layer];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -877,55 +874,37 @@ class phpbb_db_tools
|
|||
if (strpos($column_data[0], ':') !== false)
|
||||
{
|
||||
list($orig_column_type, $column_length) = explode(':', $column_data[0]);
|
||||
|
||||
if (!is_array($this->dbms_type_map[$orig_column_type . ':']))
|
||||
if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']))
|
||||
{
|
||||
$column_type = sprintf($this->db->dbms_type_map[$orig_column_type . ':'], $column_length);
|
||||
}
|
||||
|
||||
$orig_column_type .= ':';
|
||||
$column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'], $column_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
$orig_column_type = $column_data[0];
|
||||
$column_type = $this->db->dbms_type_map[$column_data[0]];
|
||||
}
|
||||
|
||||
// Get type
|
||||
if (strpos($column_data[0], ':') !== false)
|
||||
if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule']))
|
||||
{
|
||||
list($orig_column_type, $column_length) = explode(':', $column_data[0]);
|
||||
if (!is_array($this->dbms_type_map[$orig_column_type . ':']))
|
||||
{
|
||||
$column_type = sprintf($this->dbms_type_map[$orig_column_type . ':'], $column_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($this->dbms_type_map[$orig_column_type . ':']['rule']))
|
||||
{
|
||||
switch ($this->dbms_type_map[$orig_column_type . ':']['rule'][0])
|
||||
switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][0])
|
||||
{
|
||||
case 'div':
|
||||
$column_length /= $this->dbms_type_map[$orig_column_type . ':']['rule'][1];
|
||||
$column_length /= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['rule'][1];
|
||||
$column_length = ceil($column_length);
|
||||
$column_type = sprintf($this->dbms_type_map[$orig_column_type . ':'][0], $column_length);
|
||||
$column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->dbms_type_map[$orig_column_type . ':']['limit']))
|
||||
if (isset($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit']))
|
||||
{
|
||||
switch ($this->dbms_type_map[$orig_column_type . ':']['limit'][0])
|
||||
switch ($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][0])
|
||||
{
|
||||
case 'mult':
|
||||
$column_length *= $this->dbms_type_map[$orig_column_type . ':']['limit'][1];
|
||||
if ($column_length > $this->dbms_type_map[$orig_column_type . ':']['limit'][2])
|
||||
$column_length *= $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][1];
|
||||
if ($column_length > $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][2])
|
||||
{
|
||||
$column_type = $this->dbms_type_map[$orig_column_type . ':']['limit'][3];
|
||||
$column_type = $this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']['limit'][3];
|
||||
}
|
||||
else
|
||||
{
|
||||
$column_type = sprintf($this->dbms_type_map[$orig_column_type . ':'][0], $column_length);
|
||||
$column_type = sprintf($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'][0], $column_length);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -936,7 +915,7 @@ class phpbb_db_tools
|
|||
else
|
||||
{
|
||||
$orig_column_type = $column_data[0];
|
||||
$column_type = $this->dbms_type_map[$column_data[0]];
|
||||
$column_type = $this->dbms_type_map[$this->sql_layer][$column_data[0]];
|
||||
}
|
||||
|
||||
// Adjust default value if db-dependant specified
|
||||
|
|
|
@ -183,6 +183,12 @@ class install_update extends module
|
|||
);
|
||||
}
|
||||
|
||||
// Fill DB version
|
||||
if (empty($config['dbms_version']))
|
||||
{
|
||||
set_config('dbms_version', $db->sql_server_info(true));
|
||||
}
|
||||
|
||||
if ($this->test_update === false)
|
||||
{
|
||||
// Got the updater template itself updated? If so, we are able to directly use it - but only if all three files are present
|
||||
|
|
Loading…
Add table
Reference in a new issue