修改元数据同步时的数据来源判断

This commit is contained in:
Li Jianxuan 2014-04-23 02:20:23 +00:00
parent 14285c06fb
commit a27f5f15f2
1 changed files with 4 additions and 20 deletions

View File

@ -42,26 +42,7 @@ class Sync
$db2 = $conf->$source;
if($this->source == "sanjiangyuan")
{
try{
$this->source_db = new PDO(
array(
'host' => $db2->hostname,
'db' => $db2->database,
'user' => $db2->username,
'pwd' => $db2->password
)
);
$this->source_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return true;
}catch(Exception $e){
return "源数据库同步失败";
}
}
if($this->source == "qinghaihu")
{
try{
$this->source_db = new PDO(
array(
'host' => $db2->hostname,
@ -70,7 +51,10 @@ class Sync
'pwd' => $db2->password
)
);
$this->source_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return true;
}catch(Exception $e){
return "源数据库同步失败";
}
return "目标数据源不存在";