Commit 639273ed authored by Adrian Rossouw's avatar Adrian Rossouw

drupal 7 support changes

parent 635e4543
......@@ -5,7 +5,14 @@ function drush_provision_mysql_provision_deploy_validate() {
}
function drush_provision_mysql_provision_deploy($url) {
$db_type = drush_set_option('db_type', drush_get_option('db_type'), 'site');
$db_type = drush_get_option('db_type');
// As of Drupal 7 there is no more mysqli type
if (drush_drupal_major_version() >= 7) {
$db_type = ($db_type == 'mysqli') ? 'mysql' : $db_type;
}
$db_type = drush_set_option('db_type', $db_type, 'site');
$db_host = drush_set_option('db_host', drush_get_option('db_host'), 'site');
$db_passwd = drush_set_option('db_passwd', provision_password(), 'site');
$db_name = drush_set_option('db_name', _provision_mysql_suggest_db_name($url), 'site');
......
......@@ -5,7 +5,14 @@ function drush_provision_mysql_provision_install_validate() {
}
function drush_provision_mysql_pre_provision_install($url = NULL) {
$db_type = drush_set_option('db_type', drush_get_option('db_type'), 'site');
$db_type = drush_get_option('db_type');
// As of Drupal 7 there is no more mysqli type
if (drush_drupal_major_version() >= 7) {
$db_type = ($db_type == 'mysqli') ? 'mysql' : $db_type;
}
$db_type = drush_set_option('db_type', $db_type, 'site');
$db_host = drush_set_option('db_host', drush_get_option('db_host'), 'site');
$db_passwd = drush_set_option('db_passwd', provision_password(), 'site');
$db_name = drush_set_option('db_name', _provision_mysql_suggest_db_name($url), 'site');
......
......@@ -21,5 +21,12 @@ function drush_provision_drupal_provision_login_reset($url) {
// pass the login link to the front end
drush_set_option('login_link', $onetime);
drush_log(t('Login url: !onetime', array('!onetime' => $onetime)), 'message');
sess_destroy_uid(1);
if (drush_drupal_major_version() >= 7) {
drupal_session_destroy_uid(1);
}
else {
// valid for d5 and d6
sess_destroy_uid(1);
}
}
......@@ -595,4 +595,9 @@ function provision_prepare_environment() {
foreach ($fields as $key) {
$_SERVER[$key] = drush_get_option($key, null, 'site');
}
// As of Drupal 7 there is no more mysqli type
if (drush_drupal_major_version() >= 7) {
$_SERVER['db_type'] = ($_SERVER['db_type'] == 'mysqli') ? 'mysql' : $_SERVER['db_type'];
}
}
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