summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2022-01-05 21:25:38 +0100
committerAndrey Andreev <narf@devilix.net>2022-01-05 21:25:38 +0100
commitf85ee8dd6a94529b6974d826b2018cc42dbd17cb (patch)
tree0230efd5848d71e5176c07496b1880f7e3fc8057 /system/database
parent004f0a1b41c27e3d40f62a51300599d35c54c0c0 (diff)
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.
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB.php48
1 files changed, 10 insertions, 38 deletions
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