如何在yii1.0.7中设置数据库连接超时?

继承CDbConnection, 覆盖 init()方法

在 parent::init() 之前设置 $this->setAttribute(PDO::ATTR_TIMEOUT, $this->timeout); 即可。

猜你喜欢

转载自www.cnblogs.com/likwo/p/11360477.html