Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit cc8d44f21f261c880284652d4afe67724c20db62 1 parent 783b5d4
@markstory markstory authored
View
2  lib/Cake/Error/exceptions.php
@@ -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
4 lib/Cake/Model/Datasource/DboSource.php
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.