From a27f5f15f2c3d05264c7d06f2c057934526c4134 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Wed, 23 Apr 2014 02:20:23 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=83=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=97=B6=E7=9A=84=E6=95=B0=E6=8D=AE=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/Westdc/MetadataSync/Sync.php | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/vendor/Westdc/MetadataSync/Sync.php b/vendor/Westdc/MetadataSync/Sync.php index d8342cdb..cfac8ca7 100644 --- a/vendor/Westdc/MetadataSync/Sync.php +++ b/vendor/Westdc/MetadataSync/Sync.php @@ -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 "目标数据源不存在";