Skip to content

Commit

Permalink
Adding an exception for when a PDO interface is not installed.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 3, 2011
1 parent 783b5d4 commit cc8d44f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Error/exceptions.php
Expand Up @@ -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.';
}

/**
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Model/Datasource/DboSource.php
Expand Up @@ -243,7 +243,9 @@ public function __construct($config = null, $autoConnect = true) {
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();
Expand Down

0 comments on commit cc8d44f

Please sign in to comment.