File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,21 +120,22 @@ protected function parseDSN(array $params): array
120120 }
121121
122122 /**
123- * Initialize database driver .
123+ * Creates a database object .
124124 *
125125 * @param string $driver Driver name. FQCN can be used.
126- * @param array|object $argument
126+ * @param string $class 'Connection'|'Forge'|'Utils'
127+ * @param array|object $argument The constructor parameter.
127128 *
128129 * @return BaseConnection|BaseUtils|Forge
129130 */
130131 protected function initDriver (string $ driver , string $ class , $ argument ): object
131132 {
132- $ class = $ driver . '\\' . $ class ;
133-
134133 if (strpos ($ driver , '\\' ) === false ) {
135- $ class = "CodeIgniter \\Database \\{$ class }" ;
134+ $ classname = "CodeIgniter \\Database \\{$ driver }\\{$ class }" ;
135+ } else {
136+ $ classname = $ driver . '\\' . $ class ;
136137 }
137138
138- return new $ class ($ argument );
139+ return new $ classname ($ argument );
139140 }
140141}
You can’t perform that action at this time.
0 commit comments