yiisoft/yii — pull request #645 by kidol (2012-04-27 16:52:29+00:00)
Title: Suppressed a possible E_WARNING PHP error in CDbConnection::createPdoIns...

...tance() which might occured when the mysqlnd PDO driver was in use

Summary: The native mysql PDO driver may trigger a E_WARNING which will just abort the script and is unlike a proper CDbException not catchable.

Before fix:

PHP warning
PDO::__construct() [pdo.--construct]: [2002] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte. (trying to connect via tcp://localhost:3306)

After fix:

CDbException
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Es konnte keine Verbindung hergestellt werden, da der Zielcomputer die Verbindung verweigerte.

Related links:

https://bugs.php.net/bug.php?id=53185
http://www.yiiframework.com/forum/index.php/topic/31268-handle-stopped-database/