diff --git a/lib/ConnectionManager.php b/lib/ConnectionManager.php index fb16d167f..727c33dac 100644 --- a/lib/ConnectionManager.php +++ b/lib/ConnectionManager.php @@ -39,10 +39,15 @@ public static function get_connection($name=null) * Drops the connection from the connection manager. Does not actually close it since there * is no close method in PDO. * + * If $name is null then the default connection will be returned. + * * @param string $name Name of the connection to forget about */ public static function drop_connection($name=null) { + $config = Config::instance(); + $name = $name ? $name : $config->get_default_connection(); + if (isset(self::$connections[$name])) unset(self::$connections[$name]); }