Skip to content

Commit

Permalink
Removed unnessecary connect keys from all Dbo's _baseConfig. Updated …
Browse files Browse the repository at this point in the history
…connect methods where needed. Fixes #132

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information
tPl0ch authored and markstory committed Dec 27, 2009
1 parent 8b93235 commit 1eff024
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions cake/libs/model/datasources/dbo/dbo_mysql.php
Expand Up @@ -524,8 +524,7 @@ class DboMysql extends DboMysqlBase {
'login' => 'root',
'password' => '',
'database' => 'cake',
'port' => '3306',
'connect' => 'mysql_pconnect'
'port' => '3306'
);

/**
Expand Down
3 changes: 1 addition & 2 deletions cake/libs/model/datasources/dbo/dbo_mysqli.php
Expand Up @@ -47,8 +47,7 @@ class DboMysqli extends DboMysqlBase {
'login' => 'root',
'password' => '',
'database' => 'cake',
'port' => '3306',
'connect' => 'mysqli_connect'
'port' => '3306'
);

/**
Expand Down
7 changes: 3 additions & 4 deletions cake/libs/model/datasources/dbo/dbo_oracle.php
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion cake/libs/model/datasources/dbo/dbo_postgres.php
Expand Up @@ -55,7 +55,6 @@ class DboPostgres extends DboSource {
* @access protected
*/
var $_baseConfig = array(
'connect' => 'pg_pconnect',
'persistent' => true,
'host' => 'localhost',
'login' => 'root',
Expand Down
10 changes: 7 additions & 3 deletions cake/libs/model/datasources/dbo/dbo_sqlite.php
Expand Up @@ -64,8 +64,7 @@ class DboSqlite extends DboSource {
*/
var $_baseConfig = array(
'persistent' => true,
'database' => null,
'connect' => 'sqlite_popen'
'database' => null
);

/**
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1eff024

Please sign in to comment.