Skip to content

Commit

Permalink
Trigger error when dbo source is not enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathop committed Jul 20, 2013
1 parent 143d7d7 commit 09c1b61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cake/libs/model/datasources/dbo/dbo_oracle.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,15 @@ function getEncoding() {
return $row[0]['VALUE'];
}

/**
* Check whether the OCI8 extension is installed/loaded
*
* @return boolean
*/
function enabled() {
return extension_loaded('oci8');
}

/**
* Disconnects from database.
*
Expand Down
1 change: 1 addition & 0 deletions cake/libs/model/datasources/dbo_source.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ function __construct($config = null, $autoConnect = true) {
parent::__construct($config);
$this->fullDebug = Configure::read() > 1;
if (!$this->enabled()) {
trigger_error(sprintf(__('%s - Selected driver is not enabled', true), get_class($this)), E_USER_ERROR);
return false;
}
if ($autoConnect) {
Expand Down

0 comments on commit 09c1b61

Please sign in to comment.