Update database and helper functionality in CodeIgniter

Revised database drivers, query builder, and file/inflector helpers for improved consistency and functionality. Updated copyrights, links, and standardized function names including deprecating `is_countable` in favor of `word_is_countable`. Added support for new SQL features and optimized query handling.
This commit is contained in:
2025-01-22 18:50:26 +01:00
parent a8dfcfae4c
commit 453a5a89a5
219 changed files with 2041 additions and 1324 deletions
+27 -5
View File
@@ -6,7 +6,7 @@
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -29,8 +29,9 @@
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 2.1.0
* @filesource
@@ -48,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
* @subpackage Drivers
* @category Database
* @author EllisLab Dev Team
* @link https://codeigniter.com/user_guide/database/
* @link https://codeigniter.com/userguide3/database/
*/
class CI_DB_pdo_driver extends CI_DB {
@@ -131,6 +132,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);
@@ -302,7 +311,7 @@ class CI_DB_pdo_driver extends CI_DB {
$error['code'] = isset($pdo_error[1]) ? $pdo_error[0].'/'.$pdo_error[1] : $pdo_error[0];
if (isset($pdo_error[2]))
{
$error['message'] = $pdo_error[2];
$error['message'] = $pdo_error[2];
}
return $error;
@@ -326,4 +335,17 @@ class CI_DB_pdo_driver extends CI_DB {
return 'TRUNCATE TABLE '.$table;
}
// --------------------------------------------------------------------
/**
* Close DB Connection
*
* @return void
*/
protected function _close()
{
$this->result_id = FALSE;
$this->conn_id = FALSE;
}
}