Commit 3acbe381 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Use the correct mysql/mysqli driver when importing existing sites

parent 695c9b90
......@@ -81,7 +81,8 @@ function _provision_mysql_create_database($name) {
* in the Drupal db api. Sadly.
*/
function db_close($connection) {
return mysql_close($connection);
$func = PROVISION_DB_TYPE . '_close';
return $func($connection);
}
function _provision_mysql_can_create_database() {
......
......@@ -485,6 +485,11 @@ function provision_set_active_db($new_db_url = NULL) {
}
if ($new_db_url) {
preg_match("$^([a-z]*)://$", $new_db_url, $matches);
if ($matches[1] != PROVISION_DB_TYPE) {
$new_db_url = preg_replace("/^" .$matches[1]. "/", PROVISION_DB_TYPE, $new_db_url);
}
$db_url[md5($new_db_url)] = $new_db_url;
db_set_active(md5($new_db_url));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment