summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-02-13 00:39:53 +0100
committerAndrey Andreev <narf@bofh.bg>2012-02-13 00:39:53 +0100
commit46f6dbc6a60e37ad1b88458f8cdfd3e1d1d94f5e (patch)
treed5693afb1b8c77bbdb850533a52db3b4e9c51cfc
parent47489fbbb38b85584adf34032c4a88477713ddd4 (diff)
Added DSN string support
-rw-r--r--system/database/drivers/odbc/odbc_driver.php10
-rw-r--r--user_guide_src/source/changelog.rst1
2 files changed, 9 insertions, 2 deletions
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index a674c390e..c9aaa6e68 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -62,6 +62,12 @@ class CI_DB_odbc_driver extends CI_DB {
parent::__construct($params);
$this->_random_keyword = ' RND('.time().')'; // database specific random keyword
+
+ // Legacy support for DSN in the hostname field
+ if ($this->dsn == '')
+ {
+ $this->dsn = $this->hostname;
+ }
}
/**
@@ -71,7 +77,7 @@ class CI_DB_odbc_driver extends CI_DB {
*/
public function db_connect()
{
- return @odbc_connect($this->hostname, $this->username, $this->password);
+ return @odbc_connect($this->dsn, $this->username, $this->password);
}
// --------------------------------------------------------------------
@@ -83,7 +89,7 @@ class CI_DB_odbc_driver extends CI_DB {
*/
public function db_pconnect()
{
- return @odbc_pconnect($this->hostname, $this->username, $this->password);
+ return @odbc_pconnect($this->dsn, $this->username, $this->password);
}
// --------------------------------------------------------------------
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 172250133..1a38f5249 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -51,6 +51,7 @@ Release Date: Not Released
- MySQLi driver now supports persistent connections when running on PHP >= 5.3.
- Added dsn if the group connections in the config use PDO or any driver which need DSN.
- Improved PDO database support.
+ - Added DSN string support for ODBC.
- Libraries