mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Adding an exception for when a PDO interface is not installed.
This commit is contained in:
parent
783b5d4d1c
commit
cc8d44f21f
2 changed files with 4 additions and 2 deletions
|
@ -324,7 +324,7 @@ class MissingDatabaseException extends CakeException {
|
||||||
* @package Cake.Error
|
* @package Cake.Error
|
||||||
*/
|
*/
|
||||||
class MissingConnectionException extends CakeException {
|
class MissingConnectionException extends CakeException {
|
||||||
protected $_messageTemplate = 'Database connection "%s" is missing.';
|
protected $_messageTemplate = 'Database connection "%s" is missing, or could not be created.';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -243,7 +243,9 @@ class DboSource extends DataSource {
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
$this->fullDebug = Configure::read('debug') > 1;
|
$this->fullDebug = Configure::read('debug') > 1;
|
||||||
if (!$this->enabled()) {
|
if (!$this->enabled()) {
|
||||||
return;
|
throw new MissingConnectionException(array(
|
||||||
|
'class' => get_class($this)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
if ($autoConnect) {
|
if ($autoConnect) {
|
||||||
$this->connect();
|
$this->connect();
|
||||||
|
|
Loading…
Add table
Reference in a new issue