#19790379 added db check in enviroment

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8412 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2011-05-31 01:45:08 +00:00
parent 82ac064cff
commit 6e2fb02acd
13 changed files with 65 additions and 3 deletions

View file

@ -89,6 +89,48 @@
return $oDB->_getSupportedList();
}
/**
* @brief returns list of enable in supported db
* @return list of enable in supported db
**/
function getEnableList()
{
if(!$this->supported_list)
{
$oDB = new DB();
$this->supported_list = $oDB->_getSupportedList();
}
$enableList = array();
if(is_array($this->supported_list))
{
foreach($this->supported_list AS $key=>$value)
if($value->enable) array_push($enableList, $value);
}
return $enableList;
}
/**
* @brief returns list of disable in supported db
* @return list of disable in supported db
**/
function getDisableList()
{
if(!$this->supported_list)
{
$oDB = new DB();
$this->supported_list = $oDB->_getSupportedList();
}
$disableList = array();
if(is_array($this->supported_list))
{
foreach($this->supported_list AS $key=>$value)
if(!$value->enable) array_push($disableList, $value);
}
return $disableList;
}
/**
* @brief returns list of supported db
* @return list of supported db

View file

@ -230,12 +230,17 @@
// 5. Check gd(imagecreatefromgif function)
if(function_exists('imagecreatefromgif')) $checklist['gd'] = true;
else $checklist['gd'] = false;
// 6. Check DB
if(DB::getEnableList()) $checklist['db'] = true;
else $checklist['db'] = false;
if(!$checklist['php_version'] || !$checklist['permission'] || !$checklist['xml'] || !$checklist['session']) $install_enable = false;
if(!$checklist['php_version'] || !$checklist['permission'] || !$checklist['xml'] || !$checklist['session'] || !$checklist['db']) $install_enable = false;
else $install_enable = true;
// Save the checked result to the Context
Context::set('checklist', $checklist);
Context::set('install_enable', $install_enable);
Context::set('phpversion', phpversion());
return $install_enable;
}

View file

@ -176,6 +176,7 @@ EndOfLicense;
'iconv' => 'ICONV Library',
'gd' => 'GD Library',
'session' => 'Session.auto_start setting',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -174,6 +174,7 @@ EndOfLicense;
'iconv' => 'Librería ICONV',
'gd' => 'Librería GD',
'session' => 'Configuración Session.auto_start',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -174,6 +174,7 @@ EndOfLicense;
'iconv' => 'Bibliothèque de ICONV',
'gd' => 'Bibliothèque de GD',
'session' => 'Configuration de Session.auto_start',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -174,6 +174,7 @@ EndOfLicense;
'iconv' => 'ICONV 라이브러리',
'gd' => 'GD 라이브러리',
'session' => 'Session.auto_start 설정',
'db' => 'DB',
);
$lang->install_checklist_desc = array(
'php_version' => '[필수] PHP버전이 5.2.2일 경우 PHP의 버그로 인하여 설치되지 않습니다.',

View file

@ -174,6 +174,7 @@ EndOfLicense;
'iconv' => 'ICONV библиотека',
'gd' => 'GD библиотека',
'session' => 'Session.auto_start настройка',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -170,6 +170,7 @@ EndOfLicense;
'iconv' => 'ICONV Kitaplığı',
'gd' => 'GD Kitaplığı',
'session' => 'Session.auto_start(otomatik.oturum_acma) ayarı',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -177,6 +177,7 @@ EndOfLicense;
'iconv' => 'ICONV Library',
'gd' => 'GD Library',
'session' => 'Thiết lập Session.auto_start',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -179,6 +179,7 @@ EndOfLicense;
'iconv' => 'ICONV库',
'gd' => 'GD库',
'session' => 'Session.auto_start 设置',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -176,6 +176,7 @@ EndOfLicense;
'iconv' => 'ICONV Library',
'gd' => 'GD Library',
'session' => 'Session.auto_start設置',
'db' => 'DB',
);
$lang->install_checklist_desc = array(

View file

@ -8,7 +8,7 @@
<tbody>
<!--@foreach($checklist as $key => $val)-->
<tr>
<th scope="row">{$lang->install_checklist_title[$key]}</th>
<th scope="row">{$lang->install_checklist_title[$key]}<!--@if($key == 'php_version')--> (Ver. {$phpversion})<!--@end--></th>
<td><!--@if($val)-->{$lang->enable}<!--@else--><strong>{$lang->disable}</strong><br />{$lang->install_checklist_desc[$key]}<!--@end--></td>
</tr>
<!--@end-->

View file

@ -8,7 +8,13 @@
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="dispInstallDBForm" />
<ul class="form formDbSelect">
<!--@foreach(DB::getSupportedList() as $key => $val)-->
<!--@foreach(DB::getEnableList() as $key => $val)-->
<li>
<input name="db_type" type="radio" value="{$val->db_type}" <!--@if(!$val->enable)-->disabled="disabled"<!--@end--> id="db_type_{$val->db_type}" <!--@if($val->db_type=="mysql")-->checked="checked"<!--@end--> class="iRadio" id="cubrid" /> <label for="db_type_{$val->db_type}">{$val->db_type}</label>
<p>{$lang->db_desc[$val->db_type]}</p>
</li>
<!--@end-->
<!--@foreach(DB::getDisableList() as $key => $val)-->
<li>
<input name="db_type" type="radio" value="{$val->db_type}" <!--@if(!$val->enable)-->disabled="disabled"<!--@end--> id="db_type_{$val->db_type}" <!--@if($val->db_type=="mysql")-->checked="checked"<!--@end--> class="iRadio" id="cubrid" /> <label for="db_type_{$val->db_type}">{$val->db_type}</label>
<p>{$lang->db_desc[$val->db_type]}</p>