diff options
author | Wes Baker <wes@wesbaker.com> | 2012-05-07 22:49:33 +0200 |
---|---|---|
committer | Wes Baker <wes@wesbaker.com> | 2012-05-07 22:49:33 +0200 |
commit | d348135ed2131e5fa41dfa0ea7254d2f6759f3e0 (patch) | |
tree | 14cfc61c47686b895acd9e49b45c559d311195cc /tests/mocks/database/db.php | |
parent | bb2c83bddbf51c42815be3de60eab24fd87ae392 (diff) | |
parent | d207c9218531afe666168c1f5f59abd1bc19a8aa (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Conflicts:
system/core/Security.php
Diffstat (limited to 'tests/mocks/database/db.php')
-rw-r--r-- | tests/mocks/database/db.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/mocks/database/db.php b/tests/mocks/database/db.php index 43a0d391f..59028ed9c 100644 --- a/tests/mocks/database/db.php +++ b/tests/mocks/database/db.php @@ -45,19 +45,18 @@ class Mock_Database_DB { ); $config = array_merge($this->config[$group], $params); + $dsnstring = ( ! empty($config['dsn'])) ? $config['dsn'] : FALSE; + $pdodriver = ( ! empty($config['pdodriver'])) ? $config['pdodriver'] : FALSE; + $failover = ( ! empty($config['failover'])) ? $config['failover'] : FALSE; - if ( ! empty($config['dsn'])) - { - $dsn = $config['dsn']; - } - else - { - $dsn = $config['dbdriver'].'://'.$config['username'].':'.$config['password'] + $dsn = $config['dbdriver'].'://'.$config['username'].':'.$config['password'] .'@'.$config['hostname'].'/'.$config['database']; - } - + // Build the parameter $other_params = array_slice($config, 6); + if ($dsnstring) $other_params['dsn'] = $dsnstring; + if ($pdodriver) $other_params['pdodriver'] = $pdodriver; + if ($failover) $other_params['failover'] = $failover; return $dsn.'?'.http_build_query($other_params); } |