connections[$alias] = $class; return $this->connections[$alias]; } //-------------------------------------------------------------------- /** * Creates a new Forge instance for the current database type. * * @param ConnectionInterface|BaseConnection $db * * @return mixed */ public function loadForge(ConnectionInterface $db) { $className = strpos($db->DBDriver, '\\') === false ? '\CodeIgniter\Database\\' . $db->DBDriver . '\\Forge' : $db->DBDriver . '\\Forge'; // Make sure a connection exists if (! $db->connID) { $db->initialize(); } $class = new $className($db); return $class; } //-------------------------------------------------------------------- /** * Loads the Database Utilities class. * * @param ConnectionInterface|BaseConnection $db * * @return mixed */ public function loadUtils(ConnectionInterface $db) { $className = strpos($db->DBDriver, '\\') === false ? '\CodeIgniter\Database\\' . $db->DBDriver . '\\Utils' : $db->DBDriver . '\\Utils'; // Make sure a connection exists if (! $db->connID) { $db->initialize(); } $class = new $className($db); return $class; } //-------------------------------------------------------------------- }