From f85ee8dd6a94529b6974d826b2018cc42dbd17cb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 5 Jan 2022 22:25:38 +0200 Subject: Drop option to disable Query Builder I don't know if it has ever worked properly, too much things break if you do try to disable it. --- system/database/DB.php | 48 ++++++++++-------------------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) (limited to 'system/database') diff --git a/system/database/DB.php b/system/database/DB.php index c42bb6b91..12a0af7d3 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -45,10 +45,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @link https://codeigniter.com/userguide3/database/ * * @param string|string[] $params - * @param bool $query_builder_override - * Determines if query builder should be used or not */ -function &DB($params = '', $query_builder_override = NULL) +function &DB($params = '') { // Load the DB config file if a DSN string wasn't passed if (is_string($params) && strpos($params, '://') === FALSE) @@ -149,45 +147,19 @@ function &DB($params = '', $query_builder_override = NULL) show_error('You have not selected a database type to connect to.'); } - // Load the DB classes. Note: Since the query builder class is optional - // we need to dynamically create a class that extends proper parent class - // based on whether we're using the query builder class or not. - if ($query_builder_override !== NULL) - { - $query_builder = $query_builder_override; - } - // Backwards compatibility work-around for keeping the - // $active_record config variable working. Should be - // removed in v3.1 - elseif ( ! isset($query_builder) && isset($active_record)) - { - $query_builder = $active_record; - } - require_once(BASEPATH.'database/DB_driver.php'); - - if ( ! isset($query_builder) OR $query_builder === TRUE) - { - require_once(BASEPATH.'database/DB_query_builder.php'); - if ( ! class_exists('CI_DB', FALSE)) - { - /** - * CI_DB - * - * Acts as an alias for both CI_DB_driver and CI_DB_query_builder. - * - * @see CI_DB_query_builder - * @see CI_DB_driver - */ - class CI_DB extends CI_DB_query_builder { } - } - } - elseif ( ! class_exists('CI_DB', FALSE)) + require_once(BASEPATH.'database/DB_query_builder.php'); + if ( ! class_exists('CI_DB', FALSE)) { /** - * @ignore + * CI_DB + * + * Acts as an alias for both CI_DB_driver and CI_DB_query_builder. + * + * @see CI_DB_query_builder + * @see CI_DB_driver */ - class CI_DB extends CI_DB_driver { } + class CI_DB extends CI_DB_query_builder {} } // Load the DB driver -- cgit v1.2.3-24-g4f1b