Permalink
Browse files

Removed unnessecary connect keys from all Dbo's _baseConfig. Updated …

…connect methods where needed. Fixes #132

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
1 parent 8b93235 commit 1eff024e7e3360bfd79ce219efe66e5ca4096d32 tPl0ch committed with markstory Dec 24, 2009
@@ -524,8 +524,7 @@ class DboMysql extends DboMysqlBase {
'login' => 'root',
'password' => '',
'database' => 'cake',
- 'port' => '3306',
- 'connect' => 'mysql_pconnect'
+ 'port' => '3306'
);
/**
@@ -47,8 +47,7 @@ class DboMysqli extends DboMysqlBase {
'login' => 'root',
'password' => '',
'database' => 'cake',
- 'port' => '3306',
- 'connect' => 'mysqli_connect'
+ 'port' => '3306'
);
/**
@@ -172,12 +172,11 @@ function connect() {
$this->connected = false;
$config['charset'] = !empty($config['charset']) ? $config['charset'] : null;
- if ($this->config['persistent']) {
- $connect = 'ociplogon';
+ if (!$config['persistent']) {
+ $this->connection = @ocilogon($config['login'], $config['password'], $config['database'], $config['charset']);
} else {
- $connect = 'ocilogon';
+ $this->connection = @ociplogon($config['login'], $config['password'], $config['database'], $config['charset']);
}
- $this->connection = @$connect($config['login'], $config['password'], $config['database'], $config['charset']);
if ($this->connection) {
$this->connected = true;
@@ -55,7 +55,6 @@ class DboPostgres extends DboSource {
* @access protected
*/
var $_baseConfig = array(
- 'connect' => 'pg_pconnect',
'persistent' => true,
'host' => 'localhost',
'login' => 'root',
@@ -64,8 +64,7 @@ class DboSqlite extends DboSource {
*/
var $_baseConfig = array(
'persistent' => true,
- 'database' => null,
- 'connect' => 'sqlite_popen'
+ 'database' => null
);
/**
@@ -126,7 +125,12 @@ class DboSqlite extends DboSource {
*/
function connect() {
$config = $this->config;
- $this->connection = $config['connect']($config['database']);
+
+ if (!$config['persistent']) {
+ $this->connection = sqlite_open($config['database']);
+ } else {
+ $this->connection = sqlite_popen($config['database']);
+ }
$this->connected = is_resource($this->connection);
if ($this->connected) {

0 comments on commit 1eff024

Please sign in to comment.