mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-26 13:52:24 +09:00
Fix install problems
This commit is contained in:
parent
0f561b3814
commit
8cd1cdff9f
6 changed files with 44 additions and 59 deletions
|
|
@ -40,7 +40,7 @@ class installController extends install
|
|||
'user' => $config->db_user,
|
||||
'pass' => $config->db_pass,
|
||||
'database' => $config->db_database,
|
||||
'prefix' => rtrim($config->db_prefix, '_') . '_',
|
||||
'prefix' => $config->db_prefix ? (rtrim($config->db_prefix, '_') . '_') : '',
|
||||
));
|
||||
|
||||
// Check connection to the DB.
|
||||
|
|
@ -107,7 +107,7 @@ class installController extends install
|
|||
if ($install_config)
|
||||
{
|
||||
$install_config = (array)$install_config;
|
||||
$config['db']['master']['type'] = str_replace('_innodb', '', $install_config['db_type']);
|
||||
$config['db']['master']['type'] = 'mysql';
|
||||
$config['db']['master']['host'] = $install_config['db_hostname'];
|
||||
$config['db']['master']['port'] = $install_config['db_port'];
|
||||
$config['db']['master']['user'] = $install_config['db_userid'];
|
||||
|
|
@ -115,7 +115,7 @@ class installController extends install
|
|||
$config['db']['master']['database'] = $install_config['db_database'];
|
||||
$config['db']['master']['prefix'] = $install_config['db_table_prefix'];
|
||||
$config['db']['master']['charset'] = $install_config['db_charset'];
|
||||
$config['db']['master']['engine'] = strpos($install_config['db_type'], 'innodb') !== false ? 'innodb' : (strpos($install_config['db_type'], 'mysql') !== false ? 'myisam' : null);
|
||||
$config['db']['master']['engine'] = strpos($install_config['db_type'], 'innodb') !== false ? 'innodb' : 'myisam';
|
||||
$config['use_rewrite'] = $install_config['use_rewrite'] === 'Y' ? true : false;
|
||||
$config['url']['ssl'] = $install_config['use_ssl'] ?: 'none';
|
||||
$time_zone = $install_config['time_zone'];
|
||||
|
|
@ -127,7 +127,7 @@ class installController extends install
|
|||
}
|
||||
else
|
||||
{
|
||||
$config['db']['master']['type'] = str_replace('_innodb', '', $_SESSION['db_config']->db_type);
|
||||
$config['db']['master']['type'] = 'mysql';
|
||||
$config['db']['master']['host'] = $_SESSION['db_config']->db_host;
|
||||
$config['db']['master']['port'] = $_SESSION['db_config']->db_port;
|
||||
$config['db']['master']['user'] = $_SESSION['db_config']->db_user;
|
||||
|
|
@ -135,7 +135,7 @@ class installController extends install
|
|||
$config['db']['master']['database'] = $_SESSION['db_config']->db_database;
|
||||
$config['db']['master']['prefix'] = $_SESSION['db_config']->db_prefix;
|
||||
$config['db']['master']['charset'] = $_SESSION['db_config']->db_charset;
|
||||
$config['db']['master']['engine'] = strpos($_SESSION['db_config']->db_type, 'innodb') !== false ? 'innodb' : (strpos($_SESSION['db_config']->db_type, 'mysql') !== false ? 'myisam' : null);
|
||||
$config['db']['master']['engine'] = strpos($_SESSION['db_config']->db_type, 'innodb') !== false ? 'innodb' : 'myisam';
|
||||
$config['use_rewrite'] = $_SESSION['use_rewrite'] === 'Y' ? true : false;
|
||||
$config['url']['ssl'] = Context::get('use_ssl') ?: 'none';
|
||||
$time_zone = Context::get('time_zone');
|
||||
|
|
@ -227,6 +227,7 @@ class installController extends install
|
|||
catch(Exception $e)
|
||||
{
|
||||
$oDB->rollback();
|
||||
var_dump($e);exit;
|
||||
throw new Rhymix\Framework\Exception($e->getMessage());
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +244,6 @@ class installController extends install
|
|||
}
|
||||
|
||||
// Apply site lock.
|
||||
|
||||
if (Context::get('use_sitelock') === 'Y')
|
||||
{
|
||||
$user_ip_range = getView('install')->detectUserIPRange();
|
||||
|
|
@ -286,7 +286,7 @@ class installController extends install
|
|||
}
|
||||
|
||||
// Check DB
|
||||
if(DB::getEnableList())
|
||||
if(extension_loaded('pdo_mysql'))
|
||||
{
|
||||
$checklist['db_support'] = true;
|
||||
}
|
||||
|
|
@ -523,10 +523,12 @@ class installController extends install
|
|||
{
|
||||
$file = trim($schema_files[$i]);
|
||||
if(!$file || substr($file,-4)!='.xml') continue;
|
||||
$table_name = substr(basename($file), 0, -4);
|
||||
if($oDB->isTableExists($table_name)) continue;
|
||||
$output = $oDB->createTableByXmlFile($file);
|
||||
if($output === false)
|
||||
{
|
||||
throw new Exception(lang('msg_create_table_failed') . ': ' . $oDB->getError()->getMessage());
|
||||
throw new Exception(lang('msg_create_table_failed') . ': ' . basename($file) . ': ' . $oDB->getError()->getMessage());
|
||||
}
|
||||
}
|
||||
// Create a table and module instance and then execute install() method
|
||||
|
|
|
|||
|
|
@ -101,21 +101,7 @@ class installView extends install
|
|||
Context::set('use_rewrite', $_SESSION['use_rewrite'] = 'Y');
|
||||
}
|
||||
|
||||
$defaultDatabase = 'mysqli';
|
||||
$disableList = DB::getDisableList();
|
||||
if(is_array($disableList))
|
||||
{
|
||||
foreach($disableList as $key => $value)
|
||||
{
|
||||
if($value->db_type == $defaultDatabase)
|
||||
{
|
||||
$defaultDatabase = 'mysql';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Context::set('defaultDatabase', $defaultDatabase);
|
||||
Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type')));
|
||||
Context::set('error_return_url', getNotEncodedUrl('', 'act', Context::get('act')));
|
||||
$this->setTemplateFile('db_config');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,23 +9,7 @@
|
|||
<input type="hidden" value="{$error_return_url}" name="error_return_url">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="procDBConfig" />
|
||||
<div class="x_control-group">
|
||||
<label for="db_type" class="x_control-label">{$lang->db_type}</label>
|
||||
<div class="x_controls">
|
||||
<select id="db_type" name="db_type">
|
||||
<block loop="DB::getEnableList() => $key,$val">
|
||||
<option value="{$val->db_type}" selected="selected"|cond="$val->db_type==$defaultDatabase" />
|
||||
{$val->db_type}
|
||||
<block cond="$val->db_type == $defaultDatabase">({$lang->cmd_recommended})</block>
|
||||
</option>
|
||||
</block>
|
||||
<block loop="DB::getDisableList() => $key,$val">
|
||||
<option value="{$val->db_type}" disabled="disabled" />{$val->db_type} ({$lang->can_use_when_installed})</option>
|
||||
</block>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<p loop="DB::getEnableList() => $key,$val" class="install_help db_type db_type_{$val->db_type}">{$lang->db_desc[$val->db_type]}</p>
|
||||
<input type="hidden" name="db_type" value="mysql" />
|
||||
<div class="x_control-group">
|
||||
<label for="db_host" class="x_control-label">{$lang->db_hostname}</label>
|
||||
<div class="x_controls"><input name="db_host" value="localhost" type="text" id="db_host" required /></div>
|
||||
|
|
@ -48,7 +32,7 @@
|
|||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="db_prefix" class="x_control-label">{$lang->db_table_prefix}</label>
|
||||
<div class="x_controls"><input name="db_prefix" type="text" id="db_prefix" value="rx" required /></div>
|
||||
<div class="x_controls"><input name="db_prefix" type="text" id="db_prefix" value="rx_" /></div>
|
||||
</div>
|
||||
<p class="install_help">
|
||||
{$lang->db_info_desc}<br />{$lang->db_prefix_desc}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
jQuery(function($){
|
||||
$('.focus').focus();
|
||||
if($("#db_type").size()) {
|
||||
$("#db_type").click(function() {
|
||||
$("p.db_type").hide();
|
||||
$("p.db_type_" + $(this).val()).show();
|
||||
}).triggerHandler("click");
|
||||
}
|
||||
if($("#mod_rewrite_checking").size()) {
|
||||
var checking = $("#mod_rewrite_checking");
|
||||
$.ajax({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue