mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
Select InnoDB by default, fall back to MyISAM if not supported
This commit is contained in:
parent
c763bf2a93
commit
20f8a5510a
3 changed files with 32 additions and 4 deletions
|
|
@ -104,6 +104,30 @@ class installController extends install
|
|||
if(!$output->toBool()) return $output;
|
||||
if(!$oDB->isConnected()) return $oDB->getError();
|
||||
|
||||
// Check if MySQL server supports InnoDB
|
||||
if(stripos($con_string->db_type, 'innodb') !== false)
|
||||
{
|
||||
$innodb_supported = false;
|
||||
$show_engines = $oDB->_fetch($oDB->_query('SHOW ENGINES'));
|
||||
foreach($show_engines as $engine_info)
|
||||
{
|
||||
if(strcasecmp($engine_info->Engine, 'InnoDB') === 0)
|
||||
{
|
||||
$innodb_supported = true;
|
||||
}
|
||||
}
|
||||
|
||||
// If server does not support InnoDB, fall back to default storage engine (usually MyISAM)
|
||||
if(!$innodb_supported)
|
||||
{
|
||||
$con_string->db_type = str_ireplace('_innodb', '', $con_string->db_type);
|
||||
$db_info->master_db['db_type'] = $con_string->db_type;
|
||||
$db_info->slave_db[0]['db_type'] = $con_string->db_type;
|
||||
Context::set('db_type', $con_string->db_type);
|
||||
Context::setDBInfo($db_info);
|
||||
}
|
||||
}
|
||||
|
||||
// Create a db temp config file
|
||||
if(!$this->makeDBConfigFile()) return new Object(-1, 'msg_install_failed');
|
||||
|
||||
|
|
|
|||
|
|
@ -117,11 +117,12 @@ class installView extends install
|
|||
if(ini_get('safe_mode') && !Context::isFTPRegisted())
|
||||
{
|
||||
Context::set('progressMenu', '3');
|
||||
Context::set('server_ip_address', $_SERVER['SERVER_ADDR']);
|
||||
$this->setTemplateFile('ftp');
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaultDatabase = 'mysqli';
|
||||
$defaultDatabase = 'mysqli_innodb';
|
||||
$disableList = DB::getDisableList();
|
||||
if(is_array($disableList))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -483,9 +483,12 @@
|
|||
</item>
|
||||
</item>
|
||||
<item name="can_use_when_installed">
|
||||
<value xml:lang="ko"><![CDATA[설치하면 사용할 수 있음.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You can use when it has installed.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[設置すれば使用できます。]]></value>
|
||||
<value xml:lang="ko"><![CDATA[서버에 설치되어 있지 않음]]></value>
|
||||
<value xml:lang="en"><![CDATA[Not installed on this server]]></value>
|
||||
<value xml:lang="jp"><![CDATA[このサーバーにインストールされていません]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[不是这个服务器上安装]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[不是這個服務器上安裝]]></value>
|
||||
<value xml:lang="fr"><![CDATA[Pas installé sur ce serveur]]></value>
|
||||
</item>
|
||||
<item name="form_title">
|
||||
<value xml:lang="ko"><![CDATA[DB & 관리자 정보 입력]]></value>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue