Commit 13fa362b authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

#456622 - ensure that drush_invoke operates in a clean namespace and does not...

#456622 - ensure that drush_invoke operates in a clean namespace and does not mistake drupal hooks as its own. Check the issue for the conversion script.
parent 5b7e6cf7
<?php
function provision_mysql_pre_provision_backup($url = NULL) {
function drush_provision_mysql_pre_provision_backup($url = NULL) {
drush_log("Generating mysql dump for $url.", 'backup');
provision_shell_exec("mysqldump -h%s -u%s -p%s -rsites/%s/database.sql %s", drush_get_option('db_host'), drush_get_option('db_user'),drush_get_option('db_passwd'), $url, drush_get_option('db_name'));
}
function provision_mysql_pre_provision_backup_rollback($url = NULL) {
function drush_provision_mysql_pre_provision_backup_rollback($url = NULL) {
provision_path("unlink", drush_get_option('sites_path') . "/$url/database.sql", TRUE, dt("Deleted mysql dump from sites directory"),
dt("Could not delete mysql dump from sites directory"));
}
function provision_mysql_post_provision_backup($url = NULL) {
function drush_provision_mysql_post_provision_backup($url = NULL) {
provision_mysql_pre_provision_backup_rollback($url);
}
<?php
function provision_mysql_provision_delete_validate() {
function drush_provision_mysql_provision_delete_validate() {
provision_db_connect();
}
......@@ -10,7 +10,7 @@ function provision_mysql_provision_delete_validate() {
*
* This will drop the database, revoke the privileges and flush the privileges.
*/
function provision_mysql_provision_delete($url = NULL) {
function drush_provision_mysql_provision_delete($url = NULL) {
return _provision_mysql_destroy_site_db(
drush_get_option('db_name'), drush_get_option('db_user'),
drush_get_option('db_passwd'), drush_get_option('db_host'));
......
<?php
function provision_mysql_provision_deploy_validate() {
function drush_provision_mysql_provision_deploy_validate() {
provision_db_connect();
}
function provision_mysql_provision_deploy($url) {
function drush_provision_mysql_provision_deploy($url) {
$db_type = drush_set_option('db_type', drush_get_option('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');
......@@ -19,7 +19,7 @@ function provision_mysql_provision_deploy($url) {
}
function provision_mysql_provision_deploy_rollback($url = NULL) {
function drush_provision_mysql_provision_deploy_rollback($url = NULL) {
_provision_mysql_destroy_site_db(
drush_get_option('db_name'), drush_get_option('db_user'),
drush_get_option('db_passwd'), drush_get_option('db_host')
......@@ -28,7 +28,7 @@ function provision_mysql_provision_deploy_rollback($url = NULL) {
// Rollback doesn't apply here yet. Unless we trigger a deploy of the first dump
// made. Which could go on infinitely if something is really long.
function provision_mysql_post_provision_deploy($url = NULL) {
function drush_provision_mysql_post_provision_deploy($url = NULL) {
provision_path('unlink', drush_get_option('sites_path') .'/'. $url .'/database.sql', TRUE,
dt("Removed dump file @path after restoring from it"),
dt("Could not remove dump file @path"), DRUSH_PERM_ERROR);
......
<?php
function provision_mysql_provision_install_validate() {
function drush_provision_mysql_provision_install_validate() {
provision_db_connect();
}
function provision_mysql_pre_provision_install($url = NULL) {
function drush_provision_mysql_pre_provision_install($url = NULL) {
$db_type = drush_set_option('db_type', drush_get_option('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');
......@@ -19,7 +19,7 @@ function provision_mysql_pre_provision_install($url = NULL) {
_provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_client);
}
function provision_mysql_pre_provision_install_rollback($url = NULL) {
function drush_provision_mysql_pre_provision_install_rollback($url = NULL) {
_provision_mysql_destroy_site_db(
drush_get_option('db_name'), drush_get_option('db_user'),
drush_get_option('db_passwd'), drush_get_option('db_host')
......
<?php
function provision_mysql_provision_restore_validate() {
function drush_provision_mysql_provision_restore_validate() {
provision_db_connect();
}
function provision_mysql_pre_provision_restore($url = NULL) {
function drush_provision_mysql_pre_provision_restore($url = NULL) {
$db_type = drush_set_option('db_type', drush_get_option('db_type'));
$db_host = drush_set_option('db_host', drush_get_option('db_host'));
$db_passwd = drush_set_option('db_passwd', provision_password());
......@@ -14,7 +14,7 @@ function provision_mysql_pre_provision_restore($url = NULL) {
_provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_host);
}
function provision_mysql_provision_restore($url) {
function drush_provision_mysql_provision_restore($url) {
_provision_mysql_import_dump(
drush_get_option('sites_path') .'/'. $url .'/database.sql',
drush_get_option('db_name'), drush_get_option('db_user'),
......@@ -23,7 +23,7 @@ function provision_mysql_provision_restore($url) {
}
function provision_mysql_pre_provision_restore_rollback($url = NULL) {
function drush_provision_mysql_pre_provision_restore_rollback($url = NULL) {
_provision_mysql_destroy_site_db(
drush_get_option('db_name'), drush_get_option('db_user'),
drush_get_option('db_passwd'), drush_get_option('db_host'));
......@@ -41,7 +41,7 @@ function provision_mysql_pre_provision_restore_rollback($url = NULL) {
// Rollback doesn't apply here yet. Unless we trigger a restore of the first dump
// made. Which could go on infinitely if something is really long.
function provision_mysql_post_provision_restore($url = NULL) {
function drush_provision_mysql_post_provision_restore($url = NULL) {
provision_path('unlink', drush_get_option('sites_path') . '/' . $url .'/database.sql', TRUE,
dt("Removed dump file @path after restoring from it"),
dt("Could not remove dump file @path"), DRUSH_PERM_ERROR);
......
<?php
function provision_mysql_provision_verify_validate() {
function drush_provision_mysql_provision_verify_validate() {
provision_db_connect();
}
......@@ -9,7 +9,7 @@ function provision_mysql_provision_verify_validate() {
*
* Can't be rolled back.
*/
function provision_mysql_provision_verify() {
function drush_provision_mysql_provision_verify() {
if (PROVISION_CONTEXT_PLATFORM) {
if (!_provision_mysql_can_create_database()) {
drush_set_error('PROVISION_CREATE_DB_FAILED');
......@@ -20,7 +20,7 @@ function provision_mysql_provision_verify() {
}
}
function provision_mysql_post_provision_verify() {
function drush_provision_mysql_post_provision_verify() {
if (PROVISION_CONTEXT_PLATFORM) {
drush_set_option('master_db', drush_get_option('master_db'), 'drupal');
}
......
......@@ -14,7 +14,7 @@
* need to lookup the zid for the base zone of this site, and then call provision_dns_rr with the zid and site 'name'
* (ie: pull off the tld and second-level domain for the 'base' zone, and treat the rest as the 'name')
*/
function provision_dns_provision_delete($url = NULL) {
function drush_provision_dns_provision_delete($url = NULL) {
if ($url) {
# provision_dns_delete($url);
}
......
......@@ -7,7 +7,7 @@
* Provision hooks for the install command
**/
function provision_dns_pre_provision_install($url = NULL) {
function drush_provision_dns_pre_provision_install($url = NULL) {
# data should now contain zone info directly, rather than having to pull them from
if ($url) {
# $url_parts = _provision_dns_split_url($url);
......@@ -23,12 +23,12 @@ function provision_dns_pre_provision_install($url = NULL) {
}
}
function provision_dns_pre_provision_install_rollback($url = NULL) {
function drush_provision_dns_pre_provision_install_rollback($url = NULL) {
if ($url) {
# provision_dns_delete($url);
}
}
function provision_dns_post_provision_install($url = NULL) {
function drush_provision_dns_post_provision_install($url = NULL) {
# commit and restart bind
}
......@@ -11,7 +11,7 @@
* Implementation of hook_provision_pre_restore
* This is a duplicate of the _pre_install hook
**/
function provision_dns_pre_provision_restore($url = NULL) {
function drush_provision_dns_pre_provision_restore($url = NULL) {
# re-install the zonefiles and/or resource records for the site?
# _provision_dns_provision_pre_restore($url, $data);
}
......@@ -20,17 +20,17 @@ function provision_dns_pre_provision_restore($url = NULL) {
* Implementation of hook_provision_pre_restore_rollback
* This duplicates the _pre_install_rollback hook
**/
function provision_dns_pre_provision_restore_rollback($url = NULL) {
function drush_provision_dns_pre_provision_restore_rollback($url = NULL) {
# remove them again?
if ($url) {
# _provision_dns_delete($url);
}
}
function provision_dns_post_provision_restore($url = NULL) {
function drush_provision_dns_post_provision_restore($url = NULL) {
# restart bind?
}
function provision_dns_post_provision_restore_rollback($url = NULL) {
function drush_provision_dns_post_provision_restore_rollback($url = NULL) {
# restart bind
}
......@@ -9,7 +9,7 @@
/**
* Make sure the site is installed and enabled, and that we have a valid target to back up to.
*/
function provision_drupal_provision_backup_validate($url = NULL, $backup_file = NULL) {
function drush_provision_drupal_provision_backup_validate($url = NULL, $backup_file = NULL) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
if (!drush_get_option('installed')) {
drush_set_error('PROVISION_DRUPAL_SITE_NOT_FOUND');
......@@ -45,7 +45,7 @@ function provision_drupal_provision_backup_validate($url = NULL, $backup_file =
/**
* Implentation of hook_provision_backup()
*/
function provision_drupal_provision_backup($url) {
function drush_provision_drupal_provision_backup($url) {
$backup_file = drush_get_option('backup_file');
// Adds the site directory into the backup file
drush_log(dt("Adding sites directory to !backup_file", array('!backup_file' => $backup_file)), 'backup');
......@@ -60,7 +60,7 @@ function provision_drupal_provision_backup($url) {
/**
* Generate a backup tarbal for a site.
*/
function provision_drupal_post_provision_backup($url, $backup_file = NULL) {
function drush_provision_drupal_post_provision_backup($url, $backup_file = NULL) {
$backup_file = drush_get_option('backup_file');
provision_shell_exec("gzip %s", $backup_file);
......
<?php
function provision_drupal_provision_delete_validate($url = NULL, $backup_file = NULL) {
function drush_provision_drupal_provision_delete_validate($url = NULL, $backup_file = NULL) {
_provision_drupal_valid_site();
}
......@@ -9,7 +9,7 @@ function provision_drupal_provision_delete_validate($url = NULL, $backup_file =
/**
* Before starting to delete the site, make a backup
*/
function provision_drupal_pre_provision_delete($url, $backup_file) {
function drush_provision_drupal_pre_provision_delete($url, $backup_file) {
drush_invoke('provision backup', $url, $backup_file);
}
......@@ -17,7 +17,7 @@ function provision_drupal_pre_provision_delete($url, $backup_file) {
* Remove any directories for the site in sites
* This can't be rolled back. so won't even try.
*/
function provision_drupal_provision_delete($url) {
function drush_provision_drupal_provision_delete($url) {
_provision_recursive_delete(drush_get_option('sites_path') . "/$url");
_provision_drupal_delete_aliases(drush_get_option('aliases', array()));
drush_set_option('installed', FALSE, 'site');
......
......@@ -18,7 +18,7 @@
/**
* Make sure we have a valid site being deployd, and that the file being deployd from exists
*/
function provision_drupal_provision_deploy_validate($url = null, $backup_file = null) {
function drush_provision_drupal_provision_deploy_validate($url = null, $backup_file = null) {
_provision_drupal_url_required();
$exists = provision_path("exists", $backup_file, TRUE,
......@@ -33,7 +33,7 @@ function provision_drupal_provision_deploy_validate($url = null, $backup_file =
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*/
function provision_drupal_pre_provision_deploy($url, $backup_file) {
function drush_provision_drupal_pre_provision_deploy($url, $backup_file) {
$extracted = provision_path("extract", drush_get_option('backup_file'), drush_get_option('sites_path') ."/$url",
dt('Successfully extracted the contents of @path'),
dt('Failed to extract the contents of @path'),
......@@ -71,18 +71,18 @@ function provision_drupal_pre_provision_deploy($url, $backup_file) {
/**
* Remove the extracted site directory
*/
function provision_drupal_pre_provision_deploy_rollback($url) {
function drush_provision_drupal_pre_provision_deploy_rollback($url) {
if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) {
_provision_recursive_delete($site_root);
}
}
function provision_drupal_provision_deploy($url) {
function drush_provision_drupal_provision_deploy($url) {
_provision_drupal_maintain_aliases($url);
}
function provision_drupal_post_provision_deploy($url) {
function drush_provision_drupal_post_provision_deploy($url) {
_provision_drupal_create_settings_file($url);
// call the drush updatedb command.
drush_backend_invoke("updatedb", array('uri' => "http://$url"));
......
......@@ -11,7 +11,7 @@
/**
* Make sure the command we are running is on an installed site.
*/
function provision_drupal_provision_disable_validate() {
function drush_provision_drupal_provision_disable_validate() {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
if (!drush_get_option('installed')) {
......@@ -22,14 +22,14 @@ function provision_drupal_provision_disable_validate() {
/**
* Make a backup of the site before we mess with it
*/
function provision_drupal_pre_provision_disable($url, $backup_file = null) {
function drush_provision_drupal_pre_provision_disable($url, $backup_file = null) {
drush_invoke("provision backup", $url, $backup_file);
}
/**
* Set the enabled property of the site to false
*/
function provision_drupal_post_provision_disable() {
function drush_provision_drupal_post_provision_disable() {
drush_set_option('enabled', FALSE, 'site');
}
......@@ -5,12 +5,12 @@
*
* Enable a site that has been disabled
*/
function provision_drupal_provision_enable_validate() {
function drush_provision_drupal_provision_enable_validate() {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
}
function provision_drupal_post_provision_enable() {
function drush_provision_drupal_post_provision_enable() {
drush_set_option('enabled', TRUE, 'site');
}
......
......@@ -9,7 +9,7 @@
/**
* Check that the site directory at least exists.
*/
function provision_drupal_provision_import_validate() {
function drush_provision_drupal_provision_import_validate() {
_provision_drupal_url_required();
_provision_drupal_valid_site();
}
......@@ -17,7 +17,7 @@ function provision_drupal_provision_import_validate() {
/**
* Import the information about the existing site, and return it in the $data context array
*/
function provision_drupal_provision_import($url = NULL) {
function drush_provision_drupal_provision_import($url = NULL) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
drush_include_engine('drupal', 'import', drush_drupal_major_version());
drush_set_option('installed', TRUE, 'site');
......
......@@ -14,7 +14,10 @@
/**
* Check that we are trying to install a new site , and a new site only
*/
function provision_drupal_provision_install_validate() {
function drush_provision_drupal_provision_install_validate($url) {
if (!$url) {
return drush_set_error("PROVISION_URL_REQUIRED", dt("You need to specify a valid url to install a site"));
}
if (drush_get_option('installed')) {
drush_set_error('PROVISION_SITE_INSTALLED');
}
......@@ -23,7 +26,7 @@ function provision_drupal_provision_install_validate() {
/**
* Set up the directories and settings.php file that we need.
*/
function provision_drupal_pre_provision_install($url) {
function drush_provision_drupal_pre_provision_install($url) {
// This is the actual drupal provisioning requirements.
_provision_drupal_create_directories($url);
}
......@@ -34,7 +37,7 @@ function provision_drupal_pre_provision_install($url) {
* This is an external script so that php is running in it's own namespace, and
* weird problems such as the multiple database connections don't confuse drupal.
*/
function provision_drupal_provision_install($url) {
function drush_provision_drupal_provision_install($url) {
// Requires at least the database settings to complete.
_provision_drupal_create_settings_file($url);
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
......@@ -46,7 +49,7 @@ function provision_drupal_provision_install($url) {
/**
* If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
*/
function provision_drupal_provision_install_rollback($url) {
function drush_provision_drupal_provision_install_rollback($url) {
if (!drush_cmp_error('PROVISION_SITE_INSTALLED')) {
if ($url) {
_provision_recursive_delete("sites/$url");
......@@ -61,7 +64,7 @@ function provision_drupal_provision_install_rollback($url) {
* Finish the installation, regenerate the caches on the site so that
* any changes to things such as available modules/ themes can take affect.
*/
function provision_drupal_post_provision_install($url) {
function drush_provision_drupal_post_provision_install($url) {
drush_set_option('aliases', drush_get_option('aliases'), 'site');
drush_set_option('installed', TRUE, 'site');
provision_path("chmod", "./sites/$url/settings.php", 0440, dt("Secured settings.php with safe permissions"));
......
......@@ -23,28 +23,28 @@
/**
* Make sure we have a valid site being migrated, and that the file being migrated from exists
*/
function provision_drupal_provision_migrate_validate($url = null, $platform = null) {
function drush_provision_drupal_provision_migrate_validate($url = null, $platform = null) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
}
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*/
function provision_drupal_pre_provision_migrate($url, $platform) {
function drush_provision_drupal_pre_provision_migrate($url, $platform) {
drush_invoke('provision backup', $url);
}
/**
* Remove the extracted site directory
*/
function provision_drupal_pre_provision_migrate_rollback($url, $platform) {
function drush_provision_drupal_pre_provision_migrate_rollback($url, $platform) {
$success = provision_path("unlink", drush_get_option('backup_file'), TRUE, dt('Removed unused migration site package'), dt('Could not remove unused migration site package'));
}
/**
* Switch the migrate directories around now that we have the new db installed
*/
function provision_drupal_provision_migrate($url, $platform) {
function drush_provision_drupal_provision_migrate($url, $platform) {
drush_backend_invoke('provision deploy', array($url, drush_get_option('backup_file'), 'root' => $platform));
}
......@@ -52,7 +52,7 @@ function provision_drupal_provision_migrate($url, $platform) {
/**
* Delete the old site directory and recreate the settings file
*/
function provision_drupal_post_provision_migrate($url) {
function drush_provision_drupal_post_provision_migrate($url) {
drush_set_option('installed', FALSE);
_provision_drupal_delete_aliases(drush_get_option('aliases', array()));
_provision_recursive_delete(drush_get_option('sites_path') ."/$url");
......
......@@ -23,7 +23,7 @@
/**
* Make sure we have a valid site being restored, and that the file being restored from exists
*/
function provision_drupal_provision_restore_validate($url = null, $restore_file = null) {
function drush_provision_drupal_provision_restore_validate($url = null, $restore_file = null) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
$exists = provision_path("exists", $restore_file, TRUE,
......@@ -38,7 +38,7 @@ function provision_drupal_provision_restore_validate($url = null, $restore_file
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*/
function provision_drupal_pre_provision_restore($url, $restore_file) {
function drush_provision_drupal_pre_provision_restore($url, $restore_file) {
drush_invoke('provision backup', $url);
provision_path("extract", drush_get_option('restore_file'), drush_get_option('sites_path') ."/$url.restore",
......@@ -50,14 +50,14 @@ function provision_drupal_pre_provision_restore($url, $restore_file) {
/**
* Remove the extracted site directory
*/
function provision_drupal_pre_provision_restore_rollback($url) {
function drush_provision_drupal_pre_provision_restore_rollback($url) {
_provision_recursive_delete(drush_get_option('sites_path') ."/$url.restore");
}
/**
* Switch the restore directories around now that we have the new db installed
*/
function provision_drupal_provision_restore($url) {
function drush_provision_drupal_provision_restore($url) {
$old = drush_get_option('sites_path') ."/$url.restore";
$new = drush_get_option('sites_path') ."/$url";
provision_path("switch_paths", $old, $new ,
......@@ -70,14 +70,14 @@ function provision_drupal_provision_restore($url) {
}
// Luckily this is reversable =)
function provision_drupal_provision_restore_rollback($url) {
function drush_provision_drupal_provision_restore_rollback($url) {
provision_drupal_provision_restore($url);
}
/**
* Delete the old site directory and recreate the settings file
*/
function provision_drupal_post_provision_restore($url) {
function drush_provision_drupal_post_provision_restore($url) {
_provision_recursive_delete(drush_get_option('sites_path') ."/$url.restore");
_provision_drupal_create_settings_file($url);
}
......
......@@ -5,7 +5,7 @@
*
* Disable an enabled and installed site
*/
function provision_drupal_provision_verify_validate($url = null) {
function drush_provision_drupal_provision_verify_validate($url = null) {
if ($url) {
drush_errors_on();
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
......@@ -19,7 +19,7 @@ function provision_drupal_provision_verify_validate($url = null) {
/**
* implementation of provision_verify
*/
function provision_drupal_provision_verify($url = null) {
function drush_provision_drupal_provision_verify($url = null) {
if (PROVISION_CONTEXT_PLATFORM) {
_provision_create_dir(drush_get_option('config_path'), dt('Provision configuration'), 0700);
_provision_create_dir(drush_get_option('backup_path'), dt('Web server configuration'), 0700);
......@@ -45,7 +45,7 @@ function provision_drupal_provision_verify($url = null) {
/**
* Implementation of hook_provision_post_verify
*/
function provision_drupal_post_provision_verify($url = NULL) {
function drush_provision_drupal_post_provision_verify($url = NULL) {
if (PROVISION_CONTEXT_SITE) {
_provision_drupal_rebuild_caches($url);
drush_set_option('aliases', drush_get_option('aliases'), 'site');
......
<?php
function provision_apache_provision_delete($url = NULL) {
function drush_provision_apache_provision_delete($url = NULL) {
_provision_apache_delete_vhost_config($url);
return _provision_apache_restart_apache();
}
......
<?php
function provision_apache_post_provision_deploy($url = NULL) {
function drush_provision_apache_post_provision_deploy($url = NULL) {
_provision_apache_create_vhost_config($url);
_provision_apache_restart_apache();
}
......@@ -8,6 +8,6 @@ function provision_apache_post_provision_deploy($url = NULL) {
/**
* Delete the config file created.
*/
function provision_apache_post_provision_deploy_rollback($url = NULL) {
function drush_provision_apache_post_provision_deploy_rollback($url = NULL) {
_provision_apache_delete_vhost_config($url);
}
......@@ -3,7 +3,7 @@
/**
* Implementation of hook_provision_disable
*/
function provision_apache_provision_disable($url = NULL) {
function drush_provision_apache_provision_disable($url = NULL) {
drush_set_option('redirect_url', drush_get_option('web_disable_url'));
_provision_apache_create_vhost_config($url, _provision_apache_redirect_template());
_provision_apache_restart_apache();
......
......@@ -3,7 +3,7 @@
/**
* Implementation of hook_provision_enable
*/
function provision_apache_provision_enable($url = NULL) {
function drush_provision_apache_provision_enable($url = NULL) {
_provision_apache_create_vhost_config($url);
_provision_apache_restart_apache();
}
......
......@@ -10,14 +10,14 @@
/**
* Implementation of hook_provision_pre_install
*/
function provision_apache_pre_provision_install($url = NULL) {
function drush_provision_apache_pre_provision_install($url = NULL) {
return _provision_apache_create_vhost_config($url);
}
/**
* Implementation of hook_provision_post_install
*/
function provision_apache_post_provision_install($url = NULL) {
function drush_provision_apache_post_provision_install($url = NULL) {
return _provision_apache_restart_apache();
}
......@@ -3,23 +3,23 @@
/**
* Implementation of hook_provision_pre_restore
*/
function provision_apache_pre_provision_restore($url) {
function drush_provision_apache_pre_provision_restore($url) {
drush_set_option('redirect_url', drush_get_option('web_maintenance_url'));
_provision_apache_create_vhost_config($url, _provision_apache_redirect_template());
_provision_apache_restart_apache();
}
function provision_apache_pre_provision_restore_rollback($url) {
function drush_provision_apache_pre_provision_restore_rollback($url) {
_provision_apache_create_vhost_config($url);
_provision_apache_restart_apache();
}
function provision_apache_post_provision_restore($url) {
function drush_provision_apache_post_provision_restore($url) {
_provision_apache_create_vhost_config($url);
_provision_apache_restart_apache();
}
// The old db details should have been switched back by the mysql rollback at this point.
function provision_apache_post_provision_restore_rollback($url) {
function drush_provision_apache_post_provision_restore_rollback($url) {
provision_apache_post_provision_restore($url);
}
<?php
function provision_apache_provision_verify($url = null) {
function drush_provision_apache_provision_verify($url = null) {
if (PROVISION_CONTEXT_PLATFORM) {
_provision_create_dir(drush_get_option('vhost_path'), dt("Virtual host configuration"), 0700);
$data = drush_get_merged_options();
......@@ -15,7 +15,7 @@ function provision_apache_provision_verify($url = null) {
_provision_apache_restart_apache(TRUE);
}
function provision_apache_post_provision_verify($url = null) {
function drush_provision_apache_post_provision_verify($url = null) {
if (PROVISION_CONTEXT_PLATFORM) {
drush_set_option('master_url', drush_get_option('master_url'), 'drupal');
drush_set_option('publish_path', drush_get_option('publish_path'), 'drupal');
......
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