Adding an exception for when a PDO interface is not installed.

This commit is contained in:
mark_story 2011-09-03 17:03:11 +01:00
parent 783b5d4d1c
commit cc8d44f21f
2 changed files with 4 additions and 2 deletions

View file

@ -324,7 +324,7 @@ class MissingDatabaseException extends CakeException {
* @package Cake.Error
*/
class MissingConnectionException extends CakeException {
protected $_messageTemplate = 'Database connection "%s" is missing.';
protected $_messageTemplate = 'Database connection "%s" is missing, or could not be created.';
}
/**

View file

@ -243,7 +243,9 @@ class DboSource extends DataSource {
parent::__construct($config);
$this->fullDebug = Configure::read('debug') > 1;
if (!$this->enabled()) {
return;
throw new MissingConnectionException(array(
'class' => get_class($this)
));
}
if ($autoConnect) {
$this->connect();