mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Do not install if tables already exist
This commit is contained in:
parent
78cb8aea17
commit
5a7906252e
3 changed files with 13 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ class installController extends install
|
|||
'user' => $config->db_user,
|
||||
'pass' => $config->db_pass,
|
||||
'database' => $config->db_database,
|
||||
'prefix' => $config->db_prefix,
|
||||
'prefix' => rtrim($config->db_prefix, '_') . '_',
|
||||
));
|
||||
|
||||
// Check connection to the DB.
|
||||
|
|
@ -78,6 +78,16 @@ class installController extends install
|
|||
$config->db_charset = $oDB->charset;
|
||||
}
|
||||
|
||||
// Check if tables already exist.
|
||||
$table_check = array('documents', 'comments', 'modules', 'sites');
|
||||
foreach ($table_check as $table_name)
|
||||
{
|
||||
if ($oDB->isTableExists($table_name))
|
||||
{
|
||||
return new Object(-1, 'msg_table_already_exists');
|
||||
}
|
||||
}
|
||||
|
||||
// Save DB config in session.
|
||||
$_SESSION['db_config'] = $config;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue