protected function db_master(){
$db = Yii::app()->getComponent('db');
if($db)
$connection=new CDbConnection($db['connectionString'],$db['username'],$db['password']);
var_dump($connection);exit;
}
如果不抛出异常怎么写呢?
CDbConnection中用了
throw new CDbException(Yii::t(‘yii’,‘CDbConnection failed to open the DB connection.’),(int)$e->getCode(),$e->errorInfo);
本来是要做主从的,看来这样是行不通的 。还是重写 CDbConnection,
qiang有没有现成的