summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-07-28 15:40:12 +0200
committerAndrey Andreev <narf@devilix.net>2016-07-28 15:40:12 +0200
commita838279625becfba98ccb7635d35c67297129c42 (patch)
tree6ddf87407a88b84dc90503d5e7ac68c40cd07d66 /system/database/drivers
parent1748567f5442409d6a8c1e795f56599caff8296e (diff)
Remove dead code written for PHP 5.2
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php7
-rw-r--r--system/database/drivers/oci8/oci8_driver.php2
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php16
3 files changed, 6 insertions, 19 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index f52163c2d..f4597c746 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -125,8 +125,7 @@ class CI_DB_mysqli_driver extends CI_DB {
}
else
{
- // Persistent connection support was added in PHP 5.3.0
- $hostname = ($persistent === TRUE && is_php('5.3'))
+ $hostname = ($persistent === TRUE)
? 'p:'.$this->hostname : $this->hostname;
$port = empty($this->port) ? NULL : $this->port;
$socket = NULL;
@@ -502,8 +501,8 @@ class CI_DB_mysqli_driver extends CI_DB {
if ( ! empty($this->_mysqli->connect_errno))
{
return array(
- 'code' => $this->_mysqli->connect_errno,
- 'message' => is_php('5.2.9') ? $this->_mysqli->connect_error : mysqli_connect_error()
+ 'code' => $this->_mysqli->connect_errno,
+ 'message' => $this->_mysqli->connect_error
);
}
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index df7e0848a..56fdf32cf 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -386,7 +386,7 @@ class CI_DB_oci8_driver extends CI_DB {
*/
protected function _trans_begin()
{
- $this->commit_mode = is_php('5.3.2') ? OCI_NO_AUTO_COMMIT : OCI_DEFAULT;
+ $this->commit_mode = OCI_NO_AUTO_COMMIT;
return TRUE;
}
diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
index 38a5a8aff..3631cdf7a 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php
@@ -106,7 +106,7 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
empty($this->database) OR $this->dsn .= ';dbname='.$this->database;
empty($this->char_set) OR $this->dsn .= ';charset='.$this->char_set;
}
- elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE && is_php('5.3.6'))
+ elseif ( ! empty($this->char_set) && strpos($this->dsn, 'charset=', 6) === FALSE)
{
$this->dsn .= ';charset='.$this->char_set;
}
@@ -122,17 +122,6 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
*/
public function db_connect($persistent = FALSE)
{
- /* Prior to PHP 5.3.6, even if the charset was supplied in the DSN
- * on connect - it was ignored. This is a work-around for the issue.
- *
- * Reference: http://www.php.net/manual/en/ref.pdo-mysql.connection.php
- */
- if ( ! is_php('5.3.6') && ! empty($this->char_set))
- {
- $this->options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES '.$this->char_set
- .(empty($this->dbcollat) ? '' : ' COLLATE '.$this->dbcollat);
- }
-
if (isset($this->stricton))
{
if ($this->stricton)
@@ -169,8 +158,7 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver {
$this->options[PDO::MYSQL_ATTR_COMPRESS] = TRUE;
}
- // SSL support was added to PDO_MYSQL in PHP 5.3.7
- if (is_array($this->encrypt) && is_php('5.3.7'))
+ if (is_array($this->encrypt))
{
$ssl = array();
empty($this->encrypt['ssl_key']) OR $ssl[PDO::MYSQL_ATTR_SSL_KEY] = $this->encrypt['ssl_key'];