mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-20 02:42:23 +09:00
Close Connection when there is no connection value.
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@13161 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
034a5c0288
commit
f70ce644ce
1410 changed files with 7188 additions and 53541 deletions
|
|
@ -513,14 +513,30 @@ class installController extends install
|
|||
{
|
||||
if($key == 'master_db')
|
||||
{
|
||||
$buff .= $this->_getDbConnText($key, $val);
|
||||
$tmpValue = $this->_getDbConnText($key, $val);
|
||||
}
|
||||
else if($key == 'slave_db')
|
||||
{
|
||||
$buff .= $this->_getDbConnText($key, $val, true);
|
||||
$tmpValue = $this->_getDbConnText($key, $val, true);
|
||||
}
|
||||
else
|
||||
$buff .= sprintf("\$db_info->%s = '%s';" . PHP_EOL, $key, str_replace("'","\\'",$val));
|
||||
{
|
||||
if($key == 'default_url')
|
||||
{
|
||||
$tmpValue = sprintf("\$db_info->%s = '%s';" . PHP_EOL, $key, addslashes($val));
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpValue = sprintf("\$db_info->%s = '%s';" . PHP_EOL, $key, str_replace("'","\\'",$val));
|
||||
}
|
||||
}
|
||||
|
||||
if(preg_match('/(<\?|<\?php|\?>|fputs|fopen|fwrite|fgets|fread|\/\*|\*\/|chr\()/xsm', preg_replace('/\s/', '', $tmpValue)))
|
||||
{
|
||||
throw new Exception('msg_invalid_request');
|
||||
}
|
||||
|
||||
$buff .= $tmpValue;
|
||||
}
|
||||
$buff .= "?>";
|
||||
return $buff;
|
||||
|
|
@ -572,23 +588,27 @@ class installController extends install
|
|||
*/
|
||||
function makeConfigFile()
|
||||
{
|
||||
$config_file = Context::getConfigFile();
|
||||
//if(file_exists($config_file)) return;
|
||||
try {
|
||||
$config_file = Context::getConfigFile();
|
||||
//if(file_exists($config_file)) return;
|
||||
|
||||
$db_info = Context::getDbInfo();
|
||||
if(!$db_info) return;
|
||||
$db_info = Context::getDbInfo();
|
||||
if(!$db_info) return;
|
||||
|
||||
$buff = $this->_getDBConfigFileContents($db_info);
|
||||
$buff = $this->_getDBConfigFileContents($db_info);
|
||||
|
||||
FileHandler::writeFile($config_file, $buff);
|
||||
FileHandler::writeFile($config_file, $buff);
|
||||
|
||||
if(@file_exists($config_file))
|
||||
{
|
||||
FileHandler::removeFile($this->db_tmp_config_file);
|
||||
FileHandler::removeFile($this->etc_tmp_config_file);
|
||||
return true;
|
||||
if(@file_exists($config_file))
|
||||
{
|
||||
FileHandler::removeFile($this->db_tmp_config_file);
|
||||
FileHandler::removeFile($this->etc_tmp_config_file);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function installByConfig($install_config_file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue