Commit 57b6fd56 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Move to drush_invoke instead of provision_invoke

parent 99a43be1
<?php
function provision_mysql_provision_pre_backup($url = NULL) {
function provision_mysql_pre_provision_backup($url = NULL) {
drush_log("Generating mysql dump for $url.", 'backup');
provision_shell_exec("mysqldump -u%s -p%s %s > sites/%s/database.sql", drush_get_option('db_user'), drush_get_option('db_passwd'), drush_get_option('db_name'), $url);
}
function provision_mysql_provision_pre_backup_rollback($url = NULL) {
function 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_provision_post_backup($url = NULL) {
provision_mysql_provision_pre_backup_rollback($url);
function provision_mysql_post_provision_backup($url = NULL) {
provision_mysql_pre_provision_backup_rollback($url);
}
......@@ -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_provision_post_deploy($url = NULL) {
function 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);
......
......@@ -4,7 +4,7 @@ function provision_mysql_provision_install_validate() {
provision_db_connect();
}
function provision_mysql_provision_pre_install($url = NULL) {
function 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');
......@@ -14,7 +14,7 @@ function provision_mysql_provision_pre_install($url = NULL) {
_provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_host);
}
function provision_mysql_provision_pre_install_rollback($url = NULL) {
function 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')
......
......@@ -9,7 +9,7 @@
*/
include_once('provision.mysql.inc');
function provision_mysql_provision_init() {
function provision_mysql_drush_init() {
drush_set_default('master_db', $GLOBALS['db_url']);
$master_db = drush_get_option('master_db');
$db = parse_url($master_db);
......@@ -23,9 +23,10 @@ function provision_mysql_provision_init() {
drush_set_default('db_type', $db['scheme']);
}
function provision_mysql_provision_finalize() {
function provision_mysql_drush_exit() {
provision_db_close();
}
function provision_mysql_drush_help($section) {
switch ($section) {
case 'error:PROVISION_CREATE_DB_FAILED' :
......
......@@ -4,7 +4,7 @@ function provision_mysql_provision_restore_validate() {
provision_db_connect();
}
function provision_mysql_provision_pre_restore($url = NULL) {
function 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());
......@@ -23,7 +23,7 @@ function provision_mysql_provision_restore($url) {
}
function provision_mysql_provision_pre_restore_rollback($url = NULL) {
function 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_provision_pre_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_provision_post_restore($url = NULL) {
function 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);
......
......@@ -20,7 +20,7 @@ function provision_mysql_provision_verify() {
}
}
function provision_mysql_provision_post_verify() {
function provision_mysql_post_provision_verify() {
if (PROVISION_CONTEXT_PLATFORM) {
drush_set_option('master_db', drush_get_option('master_db'), 'drupal');
}
......
......@@ -7,10 +7,7 @@
* Provision hooks for the install command
**/
/**
* Implementation of hook_provision_pre_install
**/
function provision_dns_provision_pre_install($url = NULL) {
function 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);
......@@ -26,18 +23,12 @@ function provision_dns_provision_pre_install($url = NULL) {
}
}
/**
* Implementation of hook_provision_pre_install_rollback
**/
function provision_dns_provision_pre_install_rollback($url = NULL) {
function provision_dns_pre_provision_install_rollback($url = NULL) {
if ($url) {
# provision_dns_delete($url);
}
}
/**
* Implementation of hook_provision_post_install
**/
function provision_dns_provision_post_install($url = NULL) {
function 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_provision_pre_restore($url = NULL) {
function 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_provision_pre_restore($url = NULL) {
* Implementation of hook_provision_pre_restore_rollback
* This duplicates the _pre_install_rollback hook
**/
function provision_dns_provision_pre_restore_rollback($url = NULL) {
function provision_dns_pre_provision_restore_rollback($url = NULL) {
# remove them again?
if ($url) {
# _provision_dns_delete($url);
}
}
function provision_dns_provision_post_restore($url = NULL) {
function provision_dns_post_provision_restore($url = NULL) {
# restart bind?
}
function provision_dns_provision_post_restore_rollback($url = NULL) {
function provision_dns_post_provision_restore_rollback($url = NULL) {
# restart bind
}
......@@ -60,7 +60,7 @@ function provision_drupal_provision_backup($url) {
/**
* Generate a backup tarbal for a site.
*/
function provision_drupal_provision_post_backup($url, $backup_file = NULL) {
function provision_drupal_post_provision_backup($url, $backup_file = NULL) {
$backup_file = drush_get_option('backup_file');
provision_shell_exec("gzip %s", $backup_file);
......
......@@ -9,9 +9,8 @@ function provision_drupal_provision_delete_validate($url = NULL, $backup_file =
/**
* Before starting to delete the site, make a backup
*/
function provision_drupal_provision_pre_delete($url, $backup_file) {
// @TODO : fix the inline calling of provision_invoke
provision_invoke('backup', $url, $backup_file);
function provision_drupal_pre_provision_delete($url, $backup_file) {
drush_invoke('provision backup', $url, $backup_file);
}
/**
......
......@@ -38,7 +38,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_provision_pre_deploy($url, $backup_file) {
function 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'),
......@@ -76,7 +76,7 @@ function provision_drupal_provision_pre_deploy($url, $backup_file) {
/**
* Remove the extracted site directory
*/
function provision_drupal_provision_pre_deploy_rollback($url) {
function provision_drupal_pre_provision_deploy_rollback($url) {
_provision_recursive_delete(drush_get_option('sites_path') ."/$url");
}
......@@ -93,8 +93,8 @@ function provision_drupal_provision_deploy_rollback($url) {
provision_drupal_provision_deploy($url);
}
function provision_drupal_provision_post_deploy($url) {
provision_invoke('update', $url);
function provision_drupal_post_provision_deploy($url) {
drush_invoke('provision update', $url);
provision_platform_include(dirname(__FILE__), 'deploy');
drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
}
......@@ -22,14 +22,14 @@ function provision_drupal_provision_disable_validate() {
/**
* Make a backup of the site before we mess with it
*/
function provision_drupal_provision_pre_disable($url, $backup_file = null) {
provision_invoke("backup", $url, $backup_file);
function 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_provision_post_disable() {
function provision_drupal_post_provision_disable() {
drush_set_option('enabled', FALSE, 'site');
}
......@@ -388,7 +388,43 @@ function update_check_d7_settings() {
file_put_contents($conf_path .'/settings.php', "\n" . '$databases = '. var_export($databases, TRUE) . ';', FILE_APPEND);
}
}
function _drush_error_handler($error_level, $message, $filename, $line, $context) {
if ($error_level & error_reporting()) {
// All these constants are documented at http://php.net/manual/en/errorfunc.constants.php
$types = array(
E_ERROR => 'Error',
E_WARNING => 'Warning',
E_PARSE => 'Parse error',
E_NOTICE => 'Notice',
E_CORE_ERROR => 'Core error',
E_CORE_WARNING => 'Core warning',
E_COMPILE_ERROR => 'Compile error',
E_COMPILE_WARNING => 'Compile warning',
E_USER_ERROR => 'User error',
E_USER_WARNING => 'User warning',
E_USER_NOTICE => 'User notice',
E_STRICT => 'Strict warning',
E_RECOVERABLE_ERROR => 'Recoverable fatal error'
);
$backtrace = debug_backtrace();
$caller = _drupal_get_last_caller(debug_backtrace());
// We treat recoverable errors as fatal.
print_r(array(
'%type' => isset($types[$error_level]) ? $types[$error_level] : 'Unknown error',
'%message' => $message,
'%function' => $caller['function'],
'%file' => $caller['file'],
'%line' => $caller['line'],
));
}
}
function _drush_exception_handler($exception) {
// Log the message to the watchdog and return an error page to the user.
print_r($exception);
}
function update_main() {
// Some unavoidable errors happen because the database is not yet up-to-date.
......@@ -447,6 +483,8 @@ function update_main() {
drupal_maintenance_theme();
_provision_errors_on();
set_error_handler('_drush_error_handler');
set_exception_handler('_drush_exception_handler');
drupal_load_updates();
provision_drupal_install_log(update_fix_d6_requirements());
......@@ -527,12 +565,17 @@ function _update_do_one($module, $number, &$context) {
return;
}
$function = $module .'_update_'. $number;
if (function_exists($function)) {
drush_log("Running $function");
$ret = $function($context['sandbox']);
try {
$function = $module .'_update_'. $number;
if (function_exists($function)) {
drush_log("Running $function");
$ret = $function($context['sandbox']);
}
provision_drupal_install_log($ret);
}
catch (Exception $e) {
drush_log(var_dump($e, TRUE));
}
provision_drupal_install_log($ret);
if (isset($ret['#finished'])) {
$context['finished'] = $ret['#finished'];
......
......@@ -10,7 +10,7 @@ function provision_drupal_provision_enable_validate() {
}
function provision_drupal_post_enable() {
function provision_drupal_post_provision_enable() {
drush_set_option('enabled', TRUE, 'site');
}
......
......@@ -23,7 +23,7 @@ function provision_drupal_provision_install_validate() {
/**
* Set up the directories and settings.php file that we need.
*/
function provision_drupal_provision_pre_install($url) {
function provision_drupal_pre_provision_install($url) {
// This is the actual drupal provisioning requirements.
_provision_drupal_create_directories($url);
}
......@@ -60,7 +60,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_provision_post_install($url) {
function provision_drupal_post_provision_install($url) {
drush_set_option('installed', TRUE, 'site');
_provision_drupal_maintain_aliases($url);
provision_path("chmod", "./sites/$url/settings.php", 0440, dt("Secured settings.php with safe permissions"));
......
......@@ -30,14 +30,14 @@ function provision_drupal_provision_migrate_validate($url = null, $platform = nu
/**
* Make a backup before making any changes, and add extract the file we are restoring from
*/
function provision_drupal_provision_pre_migrate($url, $platform) {
provision_invoke('backup', $url);
function provision_drupal_pre_provision_migrate($url, $platform) {
drush_invoke('provision backup', $url);
}
/**
* Remove the extracted site directory
*/
function provision_provision_pre_migrate_rollback($url, $platform) {
function 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'));
}
......@@ -52,7 +52,7 @@ function provision_drupal_provision_migrate($url, $platform) {
/**
* Delete the old site directory and recreate the settings file
*/
function provision_drupal_provision_post_migrate($url) {
function provision_drupal_post_provision_migrate($url) {
drush_set_option('installed', FALSE);
_provision_recursive_delete(drush_get_option('sites_path') ."/$url");
}
......
......@@ -36,7 +36,7 @@ function provision_drupal_drush_help($section) {
* This function is executed by provision_invoke, and is responsible
* for populating the $data context array
*/
function provision_drupal_provision_init($url = NULL) {
function provision_drupal_drush_init($url = NULL) {
if ($url) {
drush_set_option('uri' , 'http://' . $url);
......@@ -58,7 +58,7 @@ function provision_drupal_provision_init($url = NULL) {
* and will allow us to cache the successful settings to the site.php/ drushrc.php
* files for future runs.
*/
function provision_drupal_provision_finalize($url = NULL) {
function provision_drupal_drush_exit($url = NULL) {
if (PROVISION_CONTEXT_SITE) {
if (drush_get_option('installed')) {
......
......@@ -38,8 +38,8 @@ 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_provision_pre_restore($url, $restore_file) {
provision_invoke('backup', $url);
function 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",
dt('Successfully extracted the contents of @path'),
......@@ -50,7 +50,7 @@ function provision_drupal_provision_pre_restore($url, $restore_file) {
/**
* Remove the extracted site directory
*/
function provision_drupal_provision_pre_restore_rollback($url) {
function provision_drupal_pre_provision_restore_rollback($url) {
_provision_recursive_delete(drush_get_option('sites_path') ."/$url.restore");
}
......@@ -77,7 +77,7 @@ function provision_drupal_provision_restore_rollback($url) {
/**
* Delete the old site directory and recreate the settings file
*/
function provision_drupal_provision_post_restore($url) {
function provision_drupal_post_provision_restore($url) {
_provision_recursive_delete(drush_get_option('sites_path') ."/$url.restore");
_provision_drupal_create_settings_file($url);
}
......
......@@ -45,7 +45,7 @@ function provision_drupal_provision_verify($url = null) {
/**
* Implementation of hook_provision_post_verify
*/
function provision_drupal_provision_post_verify($url = NULL) {
function provision_drupal_post_provision_verify($url = NULL) {
if (PROVISION_CONTEXT_SITE) {
_provision_drupal_rebuild_caches($url);
drush_set_option('installed', TRUE, 'site');
......
......@@ -53,32 +53,24 @@ include_once('provision.path.inc');
function provision_drush_command() {
$items['provision install'] = array(
'callback' => 'provision_command',
'callback arguments' => array('install'),
'arguments' => array('domain.com' => dt('The domain of the site to install.')),
'description' => dt('Provision a new site using the provided data.'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision import'] = array(
'callback' => 'provision_command',
'callback arguments' => array('import'),
'arguments' => array('domain.com' => dt('The domain of the site to import.')),
'description' => dt('Turn an already running site into a provisioned site.'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision update'] = array(
'callback' => 'provision_command',
'callback arguments' => array('update'),
'arguments' => array('domain.com' => dt('The domain of the site to update.')),
'description' => dt('Run any outstanding updates on the site.'),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision backup'] = array(
'callback' => 'provision_command',
'callback arguments' => array('backup'),
'arguments' => array('domain.com' => dt('The domain of the site to back up.')),
'optional arguments' => array('backup-file' => dt('The file to save the backup to. This will be a gzipped tarball.')),
'description' => dt('Generate a back up for the site.'),
......@@ -86,31 +78,23 @@ function provision_drush_command() {
);
$items['provision enable'] = array(
'callback' => 'provision_command',
'callback arguments' => array('enable'),
'arguments' => array('domain.com' => dt('The domain of the site to enable (only if enabled).')),
'description' => 'Enable a disabled site.',
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision disable'] = array(
'callback' => 'provision_command',
'callback arguments' => array('disable'),
'arguments' => array('domain.com' => dt('The domain of the site to disable (only if disabled).')),
'description' => 'Disable a site.',
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision verify'] = array(
'callback' => 'provision_command',
'callback arguments' => array('verify'),
'arguments' => array('domain.com' => dt('The domain of the site to verify).')),
'description' => 'Verify that the provisioning framework is correctly installed.',
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT,
);
$items['provision restore'] = array(
'callback' => 'provision_command',
'callback arguments' => array('restore'),
'description' => 'Restore the site to a previous backup. This will also generate a backup of the site as it was.',
'arguments' => array('domain.com' => dt('The domain of the site to be restored'),
'site_backup.tar.gz' => dt('The backup to restore the site to.')),
......@@ -118,8 +102,6 @@ function provision_drush_command() {
);
$items['provision deploy'] = array(
'callback' => 'provision_command',
'callback arguments' => array('deploy'),
'description' => 'Deploy an existing backup to a new url.',
'arguments' => array('domain.com' => dt('The domain to deploy the site package to.'),
'site_backup.tar.gz' => dt('The backup to deploy.')),
......@@ -127,8 +109,6 @@ function provision_drush_command() {
);
$items['provision migrate'] = array(
'callback' => 'provision_command',
'callback arguments' => array('migrate'),
'description' => 'Migrate a site between platforms.',
'arguments' => array('domain.com' => dt('The domain to migrate. Any outstanding updates will be run.'),
'/path/to/platform' => dt('The platform to migrate the site to.')),
......@@ -136,15 +116,11 @@ function provision_drush_command() {
);
$items['provision delete'] = array(
'callback' => 'provision_command',
'callback arguments' => array('delete'),
'description' => 'Delete a site.',
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
);
$items['provision cron'] = array(
'callback' => 'provision_command',
'callback arguments' => array('cron'),
'description' => 'Run cron process for site.',
'arguments' => array('domain.com' => dt('The domain of the site to be processed')),
'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_ROOT
......
......@@ -13,96 +13,6 @@
* @see provisionvalues
*/
/**
* Invoke provision api calls.
*
* Call the correct hook for all the modules that implement it. We can not use Drupal's default module_invoke, because we
* can not pass references through it.
* Additionally, the ability to rollback when an error has been encountered is also provided.
* If at any point during execution, the drush_get_error() function returns anything but 0, provision_invoke will
* trigger $hook_rollback for each of the hooks that implement it, in reverse order from how they were executed.
*
* This function will also trigger pre_$hook and post_$hook variants of the hook and it's rollbacks automatically.
*
* @param hook
* The hook name to be executed for all the modules.
* @param url
* The url of the site being invoked.
* @param data
* A reference to the associated array containing the data for the site. This needs to be a reference,
* because the modules might provide additional information about the site.
* @return
* A boolean specifying whether or not the command was successfully completed.
*
*/
function provision_invoke($hook, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL, $arg5 = NULL) {
$files = drush_scan_directory(dirname(__FILE__), $hook . ".provision.inc$");
if (is_array($files)) {
foreach ($files as $filename => $info) {
include_once($filename);
}
}
// First we build a list of functions are about to execute
$variations = array($hook . "_validate", "pre_$hook", $hook, "post_$hook");
foreach ($variations as $var_hook) {
foreach (drush_command_implements("provision_$var_hook") as $name) {
$functions[] = $name . '_provision_' . $var_hook;
}
}
$rollback = FALSE;
$completed = array();
foreach ($functions as $func) {
$completed[] = $func;
if (function_exists($func)) {
$func($arg1, $arg2, $arg3, $arg4, $arg5);
//this is run before and after so that messages appear in the correct order.
_drush_log_drupal_messages();
if (drush_get_error()) {
drush_log(dt('An error occurred at function : @func', array('@func' => $func)), 'error');
# As soon as an error occurs, roll back
$rollback = TRUE;
break;
}
}
}
// something went wrong, we need to undo
if ($rollback) {
foreach (array_reverse($completed) as $func) {
$rb_func = $func . '_rollback';
if (function_exists($rb_func)) {
$rb_func($arg1, $arg2, $arg3, $arg4, $arg5);
_drush_log_drupal_messages();
drush_log("Changes for $func module have been rolled back.", 'Rollback');
}
}
}
return !$rollback;
}
function provision_command($hook, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL, $arg5 = NULL) {
foreach (drush_command_implements("provision_init") as $name) {
$func = $name . '_provision_init';
$func($arg1, $arg2, $arg3, $arg4, $arg5);
drush_log("Initializing $name");
_drush_log_drupal_messages();
}
if (!drush_get_error()) {
provision_invoke($hook, $arg1, $arg2, $arg3, $arg4, $arg5);
}
if (!drush_get_error()) {
foreach (drush_command_implements('provision_finalize') as $name) {
$func = $name . '_provision_finalize';
$func($arg1, $arg2, $arg3, $arg4, $arg5);
_drush_log_drupal_messages();
}
}
}
/**
* @defgroup sitedata Site data management utility functions.
* @{
......@@ -166,14 +76,11 @@ function provision_load_site_data($url) {
/**
* Save modified options to the site.php file
*
* @param url
* The url of the site being invoked
* @param data
* The complete data structure that has been created. Only settings that have been changed will be recorded.
*/
function provision_save_site_data() {
drush_save_config('site');
// @TODO : remove site.php file after successful
// drushrc save.
}
/**
......@@ -286,8 +193,6 @@ function provision_shell_exec() {
return drush_shell_exec($command);
}
/**
* Check whether a user is a member of a group.
*
......
......@@ -3,19 +3,19 @@
/**
* Implementation of hook_provision_pre_deploy
*/
function provision_apache_provision_pre_deploy($url = NULL) {
function provision_apache_pre_provision_deploy($url = NULL) {
_provision_apache_create_vhost_config($url);
}
function provision_apache_provision_pre_deploy_rollback($url = NULL) {
function provision_apache_pre_provision_deploy_rollback($url = NULL) {
_provision_apache_delete_vhost_config($url);
}
function provision_apache_provision_post_deploy($url = NULL) {
function provision_apache_post_provision_deploy($url = NULL) {
_provision_apache_restart_apache();
}
// The old db details should have been switched back by the mysql rollback at this point.
function provision_apache_provision_post_deploy_rollback($url = NULL) {
provision_apache_provision_post_deploy($url);
function provision_apache_post_provision_deploy_rollback($url = NULL) {
provision_apache_post_provision_deploy($url);
}
......@@ -10,14 +10,14 @@
/**
* Implementation of hook_provision_pre_install
*/
function provision_apache_provision_pre_install($url = NULL) {
function provision_apache_pre_provision_install($url = NULL) {
return _provision_apache_create_vhost_config($url);
}
/**
* Implementation of hook_provision_post_install
*/
function provision_apache_provision_post_install($url = NULL) {
function provision_apache_post_provision_install($url = NULL) {
return _provision_apache_restart_apache();
}
......@@ -11,7 +11,7 @@
* to ensure that the sites are getting loaded up correctly.
*/
function provision_apache_provision_init() {
function provision_apache_drush_init() {
// Set up defines for platform
$docroot = drush_get_option(array("r", "root"), $_SERVER['PWD']);
......
......@@ -3,23 +3,23 @@
/**
* Implementation of hook_provision_pre_restore
*/
function provision_apache_provision_pre_restore($url) {
function 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_provision_pre_restore_rollback($url) {
function provision_apache_pre_provision_restore_rollback($url) {
_provision_apache_create_vhost_config($url);
_provision_apache_restart_apache();
}
function provision_apache_provision_post_restore($url) {
function 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_provision_post_restore_rollback($url) {
provision_apache_provision_post_restore($url);
function provision_apache_post_provision_restore_rollback($url) {
provision_apache_post_provision_restore($url);
}
......@@ -15,7 +15,7 @@ function provision_apache_provision_verify($url) {
_provision_apache_restart_apache(TRUE);
}
function provision_apache_provision_post_verify($url) {
function provision_apache_post_provision_verify($url) {