summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2021-12-20 14:47:39 +0100
committerGitHub <noreply@github.com>2021-12-20 14:47:39 +0100
commitefc96b71e4b1d13d713d8b2be01796b7d30e6f9b (patch)
tree68a44223c3c9664fbb3bea58c59cde5e3343018d /system
parent16ab872de21dcf938d9c6243d732b0206c8efa7f (diff)
parente7110e559a0c46d5001368c25ed246ff303d3afe (diff)
Merge pull request #6074 from philsturgeon/ci3-php8
CodeIgniter 3.0 on PHP 8
Diffstat (limited to 'system')
-rw-r--r--system/core/Output.php10
-rw-r--r--system/database/DB_driver.php2
-rw-r--r--system/database/drivers/pdo/pdo_driver.php8
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php7
4 files changed, 23 insertions, 4 deletions
diff --git a/system/core/Output.php b/system/core/Output.php
index c56aff4b0..bbad9f168 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -299,10 +299,14 @@ class CI_Output {
*/
public function get_header($header)
{
- // Combine headers already sent with our batched headers
+ // We only need [x][0] from our multi-dimensional array
+ $header_lines = array_map(function ($headers)
+ {
+ return array_shift($headers);
+ }, $this->headers);
+
$headers = array_merge(
- // We only need [x][0] from our multi-dimensional array
- array_map('array_shift', $this->headers),
+ $header_lines,
headers_list()
);
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index cba96d9a2..a213d5cba 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -825,7 +825,7 @@ abstract class CI_DB_driver {
{
return $this->_trans_status;
}
-
+
// --------------------------------------------------------------------
/**
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index d0a2bf959..b2178b684 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -131,6 +131,14 @@ class CI_DB_pdo_driver extends CI_DB {
$this->options[PDO::ATTR_PERSISTENT] = TRUE;
}
+ // From PHP8.0, default PDO::ATTR_ERRMODE is changed
+ // from PDO::ERRMODE_SILENT to PDO::ERRMODE_EXCEPTION
+ // as https://wiki.php.net/rfc/pdo_default_errmode
+ if ( ! isset($this->options[PDO::ATTR_ERRMODE]))
+ {
+ $this->options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_SILENT;
+ }
+
try
{
return new PDO($this->dsn, $this->username, $this->password, $this->options);
diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
index 187cb2d09..4c3a5aaea 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php
@@ -54,6 +54,13 @@ class CI_DB_pdo_pgsql_forge extends CI_DB_pdo_forge {
protected $_drop_table_if = 'DROP TABLE IF EXISTS';
/**
+ * CREATE TABLE IF statement
+ *
+ * @var string
+ */
+ protected $_create_table_if = 'CREATE TABLE IF NOT EXISTS';
+
+ /**
* UNSIGNED support
*
* @var array