? .provision.drush.inc.swp
? platform/.drupal_5_install.inc.swp
? platform/.install.provision.inc.swp
? platform/.provision_drupal.drush.inc.swp
? platform/.verify.provision.inc.swp
Index: provision.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/provision.drush.inc,v
retrieving revision 1.10
diff -u -r1.10 provision.drush.inc
--- provision.drush.inc	25 Feb 2009 17:08:11 -0000	1.10
+++ provision.drush.inc	19 Mar 2009 15:49:24 -0000
@@ -58,47 +58,57 @@
   // Set up defines for platform
   $docroot = drush_get_option(array("r", "root"), $_SERVER['PWD']);
   
-  define('PROVISION_DOMAIN', $_SERVER['HTTP_HOST']);
+  drush_set_default('provision_domain', $_SERVER['HTTP_HOST']);
+
   // Paths
-  $path =  ($docroot) ? $docroot : $_SERVER['DOCUMENT_ROOT'];
-  define('PROVISION_DOCROOT_PATH', rtrim($path, '/'));
-  define('PROVISION_SITES_PATH', rtrim($path, '/') .'/sites');
-  define('PROVISION_DRUSH_PATH', './drush.php');
-  $parts = explode("/", rtrim($path, '/'));
+  $path = drush_set_default('docroot_path', rtrim(($docroot) ? $docroot : $_SERVER['DOCUMENT_ROOT'], '/'));
+  drush_set_default('sites_path', $path . '/sites');
+
+  $parts = explode("/", $path);
   array_pop($parts);
-  define('PROVISION_PARENT_PATH', rtrim(implode("/" , $parts), '/'));
-  define('PROVISION_BACKUP_PATH', 
-    drush_get_option('backup_path', PROVISION_PARENT_PATH . '/backups'));
-  define('PROVISION_CONFIG_PATH', 
-    drush_get_option('config_path', PROVISION_PARENT_PATH .'/config'));
-  define('PROVISION_VHOST_PATH', PROVISION_CONFIG_PATH .'/vhost.d');
+  $parent_path = drush_set_default('parent_path', implode("/" , $parts));
+
+
+  drush_set_default('backup_path', $parent_path . '/backups');
+  drush_set_default('config_path', $parent_path . '/config');
+
+  $config_path = drush_get_option('config_path');
+  drush_set_default('vhost_path', $config_path . '/vhost.d');
 
   // Commands
-  define('PROVISION_RESTART_CMD',
-    drush_get_option('restart_cmd', _provision_default_restart_cmd()));
+  drush_set_default('restart_cmd', _provision_default_restart_cmd());
 
   // System account
-  $info = posix_getgrgid(posix_getgid());
-  define('PROVISION_WEB_GROUP', 
-    drush_get_option('web_group', $info['name'] ));
-  define('PROVISION_SCRIPT_USER', 
-    drush_get_option('script_user', get_current_user() ));
+  drush_set_default('web_group', _provision_default_web_group());
+  drush_set_default('script_user', get_current_user());
 
   // Redirection urls
-  define('PROVISION_MASTER_URL', 
-    drush_get_option('master_url',  $GLOBALS['base_url']));
-  define('PROVISION_WEB_DISABLE_URL', PROVISION_MASTER_URL .'/provision/disabled');
-  define('PROVISION_WEB_MAINTENENCE_URL', PROVISION_MASTER_URL .'/provision/maintenance');
+  drush_set_default('master_url', $GLOBALS['base_url']);
+  $master_url = drush_get_option('master_url');
+  drush_set_default('web_disable_url', $master_url .'/provision/disabled');
+  drush_set_default('web_maintenence_url', $master_url .'/provision/maintenance');
 
   // Database
-  define('PROVISION_MASTER_DB', 
-    drush_get_option('master_db', $GLOBALS['db_url']));
-  $db = parse_url(PROVISION_MASTER_DB);
-  define('PROVISION_DB_USER', $db['user']);
-  define('PROVISION_DB_PASSWD', $db['pass']);
-  define('PROVISION_DB_HOST', $db['host']);
+  drush_set_default('master_db', $GLOBALS['db_url']);
+
+  $master_db = drush_get_option('master_db');
+  $db = parse_url($master_db);
+  drush_set_default('master_db_user', $db['user']);
+  drush_set_default('master_db_passwd', $db['pass']);
+
+  drush_set_default('master_db_host', $db['host']);
+  drush_set_default('db_host', $db['host']);
  
-  define('PROVISION_DB_TYPE', $db['scheme']);
+  drush_set_default('master_db_type', $db['scheme']);
+  drush_set_default('db_type', $db['scheme']);
+
+  drush_set_default('publish_path', drush_get_option('docroot_path'));
+  drush_set_default('site_url', $url); 
+  drush_set_default('profile', 'default');
+  drush_set_default('web_ip', '127.0.0.1');
+  drush_set_default('web_port', 80); 
+  drush_set_default('language', 'en');
+  drush_set_default('aliases', array());
 }
 
 
@@ -214,12 +224,12 @@
  */
 function _provision_generate_config() {
   drush_log(dt("Generating drushrc.php file"));
-  provision_path("chmod", PROVISION_DOCROOT_PATH . '/drushrc.php', 0600,
+  provision_path("chmod", drush_get_option('docroot_path') . '/drushrc.php', 0600,
      dt('Changed permissions of drushrc.php to @confirm'),
       dt('Could not change permissions of drushrc.php to @confirm'));
 
   provision_save_platform_data();
-  provision_path("chmod", PROVISION_DOCROOT_PATH . '/drushrc.php', 0400,
+  provision_path("chmod", drush_get_option('docroot_path') . '/drushrc.php', 0400,
     dt('Changed permissions of drushrc.php to @confirm'),
     dt('Could not change permissions of drushrc.php to @confirm'));
   return TRUE;
@@ -249,13 +259,14 @@
 }
 
 function _provision_default_web_group() {
+  $info = posix_getgrgid(posix_getgid());
   $common_groups = array(
     'httpd',
     'www-data', 
     'apache',
     'nogroup',
     'nobody',
-    PROVISION_WEB_GROUP);
+    $info['name']);
 
   foreach ($common_groups as $group) {
     if (provision_posix_groupname($group)) {
Index: provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/provision.inc,v
retrieving revision 1.63
diff -u -r1.63 provision.inc
--- provision.inc	4 Mar 2009 18:47:59 -0000	1.63
+++ provision.inc	19 Mar 2009 15:49:25 -0000
@@ -37,7 +37,7 @@
  *   A boolean specifying whether or not the command was successfully completed. 
  * 
  */
-function provision_invoke($hook, &$data, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL, $arg5 = NULL) {
+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) {
@@ -58,7 +58,7 @@
   foreach ($functions as $func) {
     $completed[] = $func;
     if (function_exists($func)) {
-      $func($data, $arg1, $arg2, $arg3, $arg4, $arg5);
+      $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()) {
@@ -75,7 +75,7 @@
     foreach (array_reverse($completed) as $func) {
       $rb_func = $func . '_rollback';
       if (function_exists($rb_func)) {
-        $rb_func($data, $arg1, $arg2, $arg3, $arg4, $arg5);
+        $rb_func($arg1, $arg2, $arg3, $arg4, $arg5);
         _drush_log_drupal_messages();
         drush_log("Changes for $func module have been rolled back.", 'Rollback');
       }
@@ -86,22 +86,20 @@
 }
 
 function provision_command($hook, $arg1 = NULL, $arg2 = NULL, $arg3 = NULL, $arg4 = NULL, $arg5 = NULL) {
-  $data = array();
   foreach (drush_command_implements("provision_init") as $name) {
     $func = $name . '_provision_init';
-    $func($data, $arg1, $arg2, $arg3, $arg4, $arg5);
+    $func($arg1, $arg2, $arg3, $arg4, $arg5);
     drush_log("Initializing $name");
     _drush_log_drupal_messages();
   }
   if (!drush_get_error()) {
-    $success = provision_invoke($hook, $data, $arg1, $arg2, $arg3, $arg4, $arg5);
+    $success = provision_invoke($hook, $arg1, $arg2, $arg3, $arg4, $arg5);
     if ($success) {
       foreach (drush_command_implements('provision_finalize') as $name) {
         $func = $name . '_provision_finalize';
-        $func($data, $arg1, $arg2, $arg3, $arg4, $arg5);
+        $func($arg1, $arg2, $arg3, $arg4, $arg5);
         _drush_log_drupal_messages();
       }
-      $GLOBALS['args']['options'] = array_merge($GLOBALS['args']['options'], $data);
     }
   }
 }
@@ -130,20 +128,6 @@
  *   An associated array containing the relevant settings for the site.
  */
 function provision_get_site_data($url) {
-  global $args;
-  //TODO: Accept serialized string via unix pipe.
-  $site_data = $args['options'];
-  $site_data['site_url'] = $url;
-  $site_data['task_type'] = $args['commands'][1];
-  $site_data['task_id'] = drush_get_option('task_id', NULL);
-  $site_data['publish_path'] = PROVISION_DOCROOT_PATH;
-  $site_data['profile'] = ($site_data['profile']) ? $site_data['profile'] : 'default';
-  $site_data['site_ip'] =  ($site_data['site_ip']) ? $site_data['site_ip'] : '127.0.0.1';
-  $site_data['site_port'] =  ($site_data['site_port']) ? $site_data['site_port'] : '80';
-    
-  //Default to english language
-  $site_data['language'] = $site_data['language'] ? $site_data['language'] : 'en';
-
   if ($old_data = provision_load_site_data($url)) {
     //Merge previously saved data with the new data. This way, new parameters overwrite old ones.
     $site_data = array_merge($old_data, $site_data);    
@@ -165,11 +149,19 @@
  */
 function provision_load_site_data($url) {
   //Load the configuration data.
+
+  //@TODO remove this, it is a temporary measure until all site.php files are placed by drushrc.php files
+
   $conf_file = "sites/$url/site.php";
   if (file_exists($conf_file)) {
     provision_path('chmod', $conf_file, 0400);
     require($conf_file);
-    return (array) $data;
+
+    // The provision 0.1 config data might contain older data,
+    // so any data in the new drushrc.php file would be newer.
+    $site_context = _drush_get_context('site');
+    $site_context = array_merge($data, $site_context);
+    drush_set_context('site', $site_context);
   }
   return FALSE;
 }
@@ -182,36 +174,8 @@
  * @param data
  *   The complete data structure that has been created. Only settings that have been changed will be recorded.
  */
-function provision_save_site_data($data, $url) {
-  global $args;
-  $conf_file = "sites/$url/site.php";
-
-  $exclude = array('task_id', 'url', 'backend');
-  $options = array();
-  include(PROVISION_DOCROOT_PATH . '/drushrc.php'); // load drush rc
-  $exclude = array_merge($exclude, array_keys($options));
-  if (file_exists($conf_file) && !is_writable($conf_file)) {
-    provision_path("chmod", $conf_file, 0600, dt("Made site.php file writable"));
-  }
-  //initialize the file. this is lame, i know. but it will work.
-  $fp = fopen($conf_file, 'w'); //Append to the end of the config file.
-  if (!$fp) {
-    drush_set_error(DRUSH_PERM_ERROR, dt('Site config file could not be written'));
-  }
-  else {
-    fwrite($fp, "<?php\n");
-    $timestamp = mktime();
-#    fwrite($fp, "#". format_date($timestamp, 'large'));
-    foreach ($data as $key => $value) {
-      if (!in_array($key, $exclude)) {
-        $line = "\n\$data['$key'] = ". var_export($value, TRUE) .';';
-        fwrite($fp, $line);  
-      }
-    }
-    fwrite($fp, "\n");
-    fclose($fp);
-    provision_path('chmod', $conf_file, 0400, dt('Protected site.php file'));
-  }
+function provision_save_site_data() {
+  drush_save_config('site');
 }
 
 /**
@@ -223,26 +187,7 @@
  * Save the options for the platform to the drushrc.php in the root of the platform. 
  */
 function provision_save_platform_data() {
-  global $args;
-  $exclude = array('task_id');
-  $conf_file = PROVISION_DOCROOT_PATH . '/drushrc.php';
-  $fp = fopen($conf_file, "w");
-  if (!$fp) {
-    drush_set_error(DRUSH_PERM_ERROR, dt('Platform config file could not be written'));
-  }
-  else {
-    fwrite($fp, "<?php\n");
-    $timestamp = mktime();
-#    fwrite($fp, "#". format_date($timestamp, 'large'));
-    foreach ($args['options'] as $key => $value) {
-      if (!in_array($key, $exclude)) {
-        $line = "\n\$options['$key'] = ". var_export($value, TRUE) .';';
-        fwrite($fp, $line);  
-      }
-    }
-    fwrite($fp, "\n");
-    fclose($fp);
-  }
+  drush_save_config('platform');
 }
 
 /**
@@ -335,7 +280,7 @@
     $args[$x] = escapeshellcmd($args[$x]);
   }
   $command = call_user_func_array('sprintf', $args);
- 
+  drush_log($command); 
   return drush_shell_exec($command);
 }
 
@@ -406,36 +351,6 @@
   return $group;
 }
 
-function provision_proc_open($cmd, &$data = NULL) {
-  $descriptorspec = array(
-     0 => array("pipe", "r"),  // stdin is a pipe that the child will read from
-     1 => array("pipe", "w"),  // stdout is a pipe that the child will write to
-     2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to
-  );
-
-  $process = proc_open($cmd, $descriptorspec, $pipes, null, null, array('context' => $context));
-  if (is_resource($process)) {
-    if ($data) {
-      fwrite($pipes[0], serialize($data)); // pass the data array in a serialized string
-    }
-    fclose($pipes[0]);
-    $info = stream_get_meta_data($pipes[1]);
-    stream_set_blocking($pipes[1], TRUE);
-    stream_set_timeout($pipes[1], 1);
-    $stream = '';
-    while (!feof($pipes[1]) && !$info['timed_out']) { 
-      $string .= fgets($pipes[1], 4096);
-      $info = stream_get_meta_data($pipes[1]);
-      ob_flush();
-      flush();
-    };
-    fclose($pipes[1]);
-    $code = proc_close($process);
-    return array('cmd' => $cmd, 'output' => $string, 'code' => $code);
-  }
-  return false;
-}
-
 function provision_internal_init($url, $bootstrap = TRUE) {
   $url = ($url) ? $url : 'default';
   $drupal_base_url = parse_url(sprintf("http://" . $url));
@@ -475,7 +390,7 @@
   return $pass;
 }
 
-function provision_platform_include(&$data, $path, $command, $version = null, $platform = 'drupal') {
+function provision_platform_include($path, $command, $version = null, $platform = 'drupal') {
   $version = ($version) ? $version : drush_drupal_major_version();
   $options[] = sprintf("%s_%s_%s", $platform, $version, $command);
   $options[] = sprintf("%s_%s", $platform, $command);
@@ -507,3 +422,17 @@
   ini_set('error_reporting', ~E_ALL);
   ini_set('display_errors', FALSE);
 }
+
+/**
+ * This is a helper function which changes deeply nested objects into arrays
+ *
+ * This helps get past the face that objects are not simple to work with, or
+ * save in context files.
+ *
+ * This function 'misuses' a side effect of the json_decode function's second
+ * parameter. As this is done in C, and the structures we are manipulating
+ * aren't that large, it should be performant enough.
+ */
+function _scrub_object($input) {
+  return json_decode(json_encode($input), TRUE);
+}
Index: provision.path.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/provision.path.inc,v
retrieving revision 1.21
diff -u -r1.21 provision.path.inc
--- provision.path.inc	22 Feb 2009 23:11:24 -0000	1.21
+++ provision.path.inc	19 Mar 2009 15:49:25 -0000
@@ -187,7 +187,7 @@
 
 function provision_path_chgrp($path, &$gid, &$reason) {
   if ($group = provision_posix_groupname($gid)) {
-    if (provision_user_in_group(PROVISION_SCRIPT_USER, $gid)) {
+    if (provision_user_in_group(drush_get_option('script_user'), $gid)) {
       if (chgrp($path, $group)) {
         return $group;
       }
@@ -196,7 +196,7 @@
       }
     }
     else {
-      $reason = dt("@user is not in @group group", array("@user" => PROVISION_SCRIPT_USER, "@group" => $group));
+      $reason = dt("@user is not in @group group", array("@user" => drush_get_option('script_user'), "@group" => $group));
     }
   }
   elseif (!@chgrp($path, $gid)) { # try to change the group anyways
@@ -302,7 +302,7 @@
   }
 
   if ($exists) {
-    provision_path("chown", $path, PROVISION_SCRIPT_USER, 
+    provision_path("chown", $path, drush_get_option('script_user'), 
       $name . ' ' . dt("ownership of path has been changed to @confirm."),
       $name . ' ' . dt("ownership of path could not be changed to @confirm."),
       DRUSH_PERM_ERROR);
Index: db_server/backup.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/backup.provision.inc,v
retrieving revision 1.3
diff -u -r1.3 backup.provision.inc
--- db_server/backup.provision.inc	22 Feb 2009 22:43:57 -0000	1.3
+++ db_server/backup.provision.inc	19 Mar 2009 15:49:25 -0000
@@ -1,16 +1,16 @@
 <?php
 
-function provision_mysql_provision_pre_backup(&$data, $url = NULL) {
+function provision_mysql_provision_pre_backup($url = NULL) {
   drush_log("Generating mysql dump for $url.", 'backup');
-  provision_shell_exec("mysqldump -u%s -p%s %s > sites/%s/database.sql", $data['db_user'], $data['db_passwd'], $data['db_name'], $url); 
+  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(&$data, $url = NULL) {
-  provision_path("unlink", PROVISION_SITES_PATH . "/$url/database.sql", TRUE, dt("Deleted mysql dump from sites directory"), 
+function provision_mysql_provision_pre_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(&$data, $url = NULL) {
-  provision_mysql_provision_pre_backup_rollback($data, $url);
+function provision_mysql_provision_post_backup($url = NULL) {
+  provision_mysql_provision_pre_backup_rollback($url);
 }
 
Index: db_server/delete.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/delete.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 delete.provision.inc
--- db_server/delete.provision.inc	9 Dec 2008 02:17:48 -0000	1.1
+++ db_server/delete.provision.inc	19 Mar 2009 15:49:25 -0000
@@ -10,7 +10,9 @@
  *
  * This will drop the database, revoke the privileges and flush the privileges.
  */
-function provision_mysql_provision_delete(&$data, $url = NULL) {
-  return _provision_mysql_destroy_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+function 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'));
 }
 
Index: db_server/deploy.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/deploy.provision.inc,v
retrieving revision 1.2
diff -u -r1.2 deploy.provision.inc
--- db_server/deploy.provision.inc	22 Feb 2009 22:43:57 -0000	1.2
+++ db_server/deploy.provision.inc	19 Mar 2009 15:49:25 -0000
@@ -4,26 +4,32 @@
   provision_db_connect();
 }
 
-function provision_mysql_provision_deploy(&$data, $url) {
-  # generate a random password for use
-  $data['db_passwd'] = provision_password(); 
-  $data['db_name'] = _provision_mysql_suggest_db_name($data, $url);
-  $data['db_user'] = $data['db_name'];
+function 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');
+  $db_name = drush_set_option('db_name', _provision_mysql_suggest_db_name($url), 'site');
+  $db_user = drush_set_option('db_user', $db_name, 'site');
 
-  _provision_mysql_new_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+  _provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_host);
 
-  _provision_mysql_import_dump(PROVISION_SITES_PATH .'/'. $url .'/database.sql', $data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+  _provision_mysql_import_dump(
+    drush_get_option('sites_path') .'/'. $url .'/database.sql',
+    $db_name, $db_user, $db_passwd, $db_host );
 }
 
 
-function provision_mysql_provision_deploy_rollback(&$data, $url = NULL) {
-  _provision_mysql_destroy_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+function 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')
+  );
 }
 
 // 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(&$data, $url = NULL) {
-  provision_path('unlink', 'sites/'. $url .'/database.sql', TRUE,
+function provision_mysql_provision_post_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);
 }
Index: db_server/install.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/install.provision.inc,v
retrieving revision 1.2
diff -u -r1.2 install.provision.inc
--- db_server/install.provision.inc	3 Feb 2009 00:34:11 -0000	1.2
+++ db_server/install.provision.inc	19 Mar 2009 15:49:25 -0000
@@ -4,23 +4,19 @@
   provision_db_connect();
 }
 
-function provision_mysql_provision_pre_install(&$data, $url = NULL) {
-  $data['db_type'] = ($data['db_type']) ? $data['db_type'] : PROVISION_DB_TYPE;
-  $data['db_host'] = ($data['db_host']) ? $data['db_host'] : PROVISION_DB_HOST;
+function provision_mysql_provision_pre_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');
+  $db_name = drush_set_option('db_name', _provision_mysql_suggest_db_name($url), 'site');
+  $db_user = drush_set_option('db_user', $db_name, 'site');
 
-  # generate a random password for use
-  $data['db_passwd'] = provision_password(); 
-  $data['db_name'] = _provision_mysql_suggest_db_name($data, $url);
-  $data['db_user'] = $data['db_name']; 
-
-  _provision_mysql_new_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+  _provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_host);
 }
 
-function provision_mysql_provision_pre_install_rollback(&$data, $url = NULL) {
-  _provision_mysql_destroy_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
-  unset($data['db_host']);
-  unset($data['db_type']);
-  unset($data['db_passwd']);
-  unset($data['db_user']);
-  unset($data['db_name']);
+function provision_mysql_provision_pre_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')
+  );
 }
Index: db_server/provision.mysql.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/provision.mysql.inc,v
retrieving revision 1.18
diff -u -r1.18 provision.mysql.inc
--- db_server/provision.mysql.inc	22 Feb 2009 22:43:57 -0000	1.18
+++ db_server/provision.mysql.inc	19 Mar 2009 15:49:25 -0000
@@ -18,7 +18,7 @@
   if (_provision_db_connection()) {
     return TRUE;
   }
-  $connection = @mysql_connect(PROVISION_DB_HOST, PROVISION_DB_USER, PROVISION_DB_PASSWD);
+  $connection = @mysql_connect(drush_get_option('master_db_host'), drush_get_option('master_db_user'), drush_get_option('master_db_passwd'));
 
   if (!$connection) {
     drush_set_error('PROVISION_MASTER_DB_FAILED', dt('Could not connect to the master database.'), 'error');
Index: db_server/provision_mysql.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/provision_mysql.drush.inc,v
retrieving revision 1.4
diff -u -r1.4 provision_mysql.drush.inc
--- db_server/provision_mysql.drush.inc	22 Feb 2009 22:43:57 -0000	1.4
+++ db_server/provision_mysql.drush.inc	19 Mar 2009 15:49:25 -0000
@@ -62,7 +62,7 @@
  */
 function _provision_mysql_destroy_site_db($db_name, $db_user, $db_passwd, $db_host) {
     
-  if ( _provision_mysql_database_exists($data['db_name']) ) {
+  if ( _provision_mysql_database_exists($db_name) ) {
     drush_log(dt("Dropping database @dbname", array('@dbname' => $db_name)));
     if (!_provision_mysql_drop_database($db_name)) {
       drush_log(dt("Failed to drop database @dbname", array('@dbname' => $db_name)), 'warning');
@@ -147,9 +147,9 @@
  * possible that sites will be running with derivative names on the same server,
  * until the upgrade / restore process is completed.
  */ 
-function _provision_mysql_suggest_db_name($data, $url) {
-  if ($data['site_id']) {
-    $id_suggest = 'site_'. $data['site_id'];
+function _provision_mysql_suggest_db_name($url) {
+  if ($sid = drush_get_option('site_id')) {
+    $id_suggest = 'site_'. $sid;
     $suggest[] = $id_suggest;
     for ($i = 0; $i < 100; $i++) {
       $suggest[] = $id_suggest .'_'. $i;
Index: db_server/restore.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/restore.provision.inc,v
retrieving revision 1.4
diff -u -r1.4 restore.provision.inc
--- db_server/restore.provision.inc	5 Mar 2009 21:05:41 -0000	1.4
+++ db_server/restore.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -4,43 +4,59 @@
   provision_db_connect();
 }
 
-function provision_mysql_provision_pre_restore(&$data, $url = NULL) {
-  // store a backup of the credentials of the site.
-  $data['old_db_name'] = $data['db_name'];
-  $data['old_db_passwd'] = $data['db_passwd'];
-  $data['old_db_user'] = $data['db_user'];
-  $data['old_db_host'] = $data['db_host'];
-
-  # generate a random password for use
-  $data['db_passwd'] = provision_password(); 
-  $data['db_name'] = _provision_mysql_suggest_db_name($data, $url);
-  $data['db_user'] = $data['db_name'];
+function provision_mysql_provision_pre_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());
+  $db_name   = drush_set_option('db_name', _provision_mysql_suggest_db_name($url));
+  $db_user   = drush_set_option('db_user', $db_name);
 
-  _provision_mysql_new_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+  _provision_mysql_new_site_db($db_name, $db_user, $db_passwd, $db_host);
 }
 
-function provision_mysql_provision_restore(&$data, $url) {
-  _provision_mysql_import_dump(PROVISION_SITES_PATH .'/'. $url .'/database.sql', $data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+function 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'),
+    drush_get_option('db_passwd'), drush_get_option('db_host')
+  );
 }
 
 
-function provision_mysql_provision_pre_restore_rollback(&$data, $url = NULL) {
-  _provision_mysql_destroy_site_db($data['db_name'], $data['db_user'], $data['db_passwd'], $data['db_host']);
+function provision_mysql_provision_pre_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'));
 
   $keys = array('db_name', 'db_passwd', 'db_user', 'db_host');
+
   //Restore the original database credentials of the site.
+  // They were never truly lost, but the options in the 'process' context
+  // were overriding them. By unsetting the temporary options, the originals
+  // are automatically restored.
   foreach ($keys as $key) {
-    $data[$key] = $data['old_'. $key];
+    drush_unset_option($key, 'process');
   }
 }
 
 // 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(&$data, $url = NULL) {
-  print_r($data);
-  provision_path('unlink', 'sites/'. $url .'/database.sql', TRUE,
+function provision_mysql_provision_post_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);
-  #_provision_mysql_destroy_site_db($data['old_db_name'], $data['old_db_user'], $data['old_db_passwd'], $data['old_db_host']);
+
+  // We have now completed successfully, remove the old database.
+  _provision_mysql_destroy_site_db(
+    drush_get_option('db_name', null, 'site'), drush_get_option('db_user', null, 'site'),
+    drush_get_option('db_passwd', null, 'site'), drush_get_option('db_host', null, 'site')
+  );
+
+  // The new database credentials will be saved against the site now.
+  drush_set_option('db_name', drush_get_option('db_name'), 'site');
+  drush_set_option('db_type', drush_get_option('db_type'), 'site');
+  drush_set_option('db_user', drush_get_option('db_user'), 'site');
+  drush_set_option('db_host', drush_get_option('db_host'), 'site');
+  drush_set_option('db_passwd', drush_get_option('db_passwd'), 'site');
 }
 
Index: db_server/verify.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/db_server/verify.provision.inc,v
retrieving revision 1.4
diff -u -r1.4 verify.provision.inc
--- db_server/verify.provision.inc	25 Feb 2009 17:08:12 -0000	1.4
+++ db_server/verify.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -20,3 +20,9 @@
   }
 }
 
+function provision_mysql_provision_post_verify() {
+  if (PROVISION_CONTEXT_PLATFORM) {
+    drush_set_option('master_db', drush_get_option('master_db'), 'platform');
+  }
+}
+
Index: dns_server/delete.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/dns_server/delete.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 delete.provision.inc
--- dns_server/delete.provision.inc	18 Feb 2009 05:01:43 -0000	1.1
+++ dns_server/delete.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -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(&$data, $url = NULL) {
+function provision_dns_provision_delete($url = NULL) {
   if ($url) {
 #    provision_dns_delete($url);
   }
Index: dns_server/install.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/dns_server/install.provision.inc,v
retrieving revision 1.3
diff -u -r1.3 install.provision.inc
--- dns_server/install.provision.inc	10 Mar 2009 19:55:51 -0000	1.3
+++ dns_server/install.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -10,7 +10,7 @@
 /**
  * Implementation of hook_provision_pre_install
  **/
-function provision_dns_provision_pre_install(&$data, $url = NULL) {
+function provision_dns_provision_pre_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);
@@ -20,16 +20,16 @@
 #    }
 
     # the zone object should be passed in..
-#    $zone = provision_dns_create_zone($url_parts['zone'], $data);   # initialize zone for this domain (if it doesn't exist)
-#    provision_dns_create_record($url_parts['host'], $zone, $data);    # creates the RR for the (sub)domain
-#    provision_dns_commit($data['dns_id']);                            # makes the changes live (ie: restart bind)
+#    $zone = provision_dns_create_zone($url_parts['zone']);   # initialize zone for this domain (if it doesn't exist)
+#    provision_dns_create_record($url_parts['host'], $zone);    # creates the RR for the (sub)domain
+#    provision_dns_commit(drush_get_option('dns_id'));                            # makes the changes live (ie: restart bind)
   }
 }
 
 /**
  * Implementation of hook_provision_pre_install_rollback
  **/
-function provision_dns_provision_pre_install_rollback(&$data, $url = NULL) {
+function provision_dns_provision_pre_install_rollback($url = NULL) {
   if ($url) {
 #    provision_dns_delete($url);
   }
@@ -38,6 +38,6 @@
 /**
  * Implementation of hook_provision_post_install
  **/
-function provision_dns_provision_post_install(&$data, $url = NULL) {
+function provision_dns_provision_post_install($url = NULL) {
   # commit and restart bind
 }
Index: dns_server/provision_dns.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/dns_server/provision_dns.drush.inc,v
retrieving revision 1.3
diff -u -r1.3 provision_dns.drush.inc
--- dns_server/provision_dns.drush.inc	10 Mar 2009 19:20:10 -0000	1.3
+++ dns_server/provision_dns.drush.inc	19 Mar 2009 15:49:26 -0000
@@ -17,26 +17,25 @@
  *
  * @param $domain
  *   The domain name/origin for the zone to be created.
- * @param $data
- *   An array of data to populate the new zone. Most importantly, the 'dns_id' 
- *   field must contain the nid of the DNS server which on which to privision this zone.
  *
  * @return
  *   The zone object, whether newly created, or already existing.
  **/
-function provision_dns_create_zone($domain, $data) {
-  $writable = provision_path("writable", PROVISION_NAMED_PATH, TRUE, NULL, 
+function provision_dns_create_zone($domain) {
+  /*
+    $writable = provision_path("writable", PROVISION_NAMED_PATH, TRUE, NULL, 
                              t("DNS configuration path @path is not writable"), 
                              PROVISION_PERM_ERROR | PROVISION_FRAMEWORK_ERROR);
-
+  */
 #  if ($zone = provision_dns_status('zone', array('domain' => $domain))) {
 #    drush_log("Notice", t("Loading zone file for url @url", array('@url' => $domain)));
 #    return $zone;
 #  } else {
-    drush_log("Notice", dt("Generating zone file for url @url on dns server @id", array('@url' => $domain, '@id' => $data['dns_id'])));
+/**
+  drush_log("Notice", dt("Generating zone file for url @url on dns server @id", array('@url' => $domain, '@id' => drush_get_option('dns_id'))));
     # Setup args array from defaults
-    $dns = node_load($data['dns_id']);
-    $zone_fields['dns_id'] = $data['dns_id'];
+    $dns = node_load(drush_get_option('dns_id'));
+    $zone_fields['dns_id'] = drush_get_option('dns_id');
     $zone_fields['origin'] = $domain;
     $zone_fields['serial'] = date('Ymd') . '01';
     $ns_recs = explode("\n", $dns->ns);
@@ -46,6 +45,7 @@
     $zone_fields['ns2'] = $ns_recs[1];
     $zone_fields['mbox'] = $dns->mbox;
     provision_dns_zone('add', $zone_fields);
+ */
 #    $zone = provision_dns_status('zone', array('domain' => $domain));
 #    foreach ($ns_recs as $ns) {
 #      provision_dns_create_record('@', $zone, array('type' => 'NS', 'dns_ip' => trim($ns))); 
@@ -61,18 +61,15 @@
  *   The name part of the record to be created.
  * @param $zone
  *   The zone object in which to create the record.
- * @param $data
- *   An array of data used to populate the record. Most importantly, the 'dns_ip' field should
- *   contain the IP address which the host record should point to.
  *
  * @return
  *   The record object, or FALSE if the record could not be created.
  **/
-function provision_dns_create_record($host, $zone, $data) {
-  drush_log(dt("Creating %type record for url @url", array('%type' => $data['type'], '@url' => $host)));
+function provision_dns_create_record($host, $zone) {
+  drush_log(dt("Creating %type record for url @url", array('%type' => drush_get_option('type'), '@url' => $host)));
   $rec['name'] = $host;
-  $rec['type'] = $data['type']?$data['type']:'A';
-  $rec['data'] = $data['dns_ip'];
+  $rec['type'] = drush_get_option('type');
+  $rec['data'] = drush_get_option('dns_ip');
   return provision_dns_rr('add', $zone->zid, $rec);
 }
 
Index: dns_server/restore.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/dns_server/restore.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 restore.provision.inc
--- dns_server/restore.provision.inc	18 Feb 2009 05:01:43 -0000	1.1
+++ dns_server/restore.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -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(&$data, $url = NULL) {
+function provision_dns_provision_pre_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 @@
  * Implementation of hook_provision_pre_restore_rollback
  * This duplicates the _pre_install_rollback hook
  **/
-function provision_dns_provision_pre_restore_rollback(&$data, $url = NULL) {
+function provision_dns_provision_pre_restore_rollback($url = NULL) {
   # remove them again?
   if ($url) {
 #    _provision_dns_delete($url);
   }
 }
 
-function provision_dns_provision_post_restore(&$data, $url = NULL) {
+function provision_dns_provision_post_restore($url = NULL) {
   # restart bind?
 }
 
-function provision_dns_provision_post_restore_rollback(&$data, $url = NULL) {
+function provision_dns_provision_post_restore_rollback($url = NULL) {
   # restart bind
 }
Index: dns_server/verify.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/dns_server/verify.provision.inc,v
retrieving revision 1.3
diff -u -r1.3 verify.provision.inc
--- dns_server/verify.provision.inc	12 Mar 2009 18:29:29 -0000	1.3
+++ dns_server/verify.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -12,7 +12,8 @@
  *
  * Can't be rolled back.
  */
-function provision_dns_provision_verify(&$data, $url = NULL) {
+/*
+function provision_dns_provision_verify($url = NULL) {
   if (!$url) {
     // we are verifying a platform
 # Where does this constant come from now?
@@ -29,9 +30,9 @@
       return;
     }
 
-#    $zone = provision_dns_create_zone($url_parts['zone'], $data);   # initializes the zone for the domain (if it doesn't exist)
-#    provision_dns_create_record($url_parts['host'], $zone, $data);    # creates the RR for the (sub)domain
-#    provision_dns_commit($data['dns_id']);                            # makes the changes live (ie: restart bind)
+#    $zone = provision_dns_create_zone($url_parts['zone']);   # initializes the zone for the domain (if it doesn't exist)
+#    provision_dns_create_record($url_parts['host'], $zone);    # creates the RR for the (sub)domain
+#    provision_dns_commit(drush_get_option('dns_id'));                            # makes the changes live (ie: restart bind)
   }
 }
-
+ */
Index: itk/provision_itk.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/itk/provision_itk.module,v
retrieving revision 1.1
diff -u -r1.1 provision_itk.module
--- itk/provision_itk.module	11 Feb 2009 22:34:11 -0000	1.1
+++ itk/provision_itk.module	19 Mar 2009 15:49:26 -0000
@@ -10,6 +10,6 @@
 /**
  * implementation of hook_provision_vhost_extra
  */
-function provision_itk_provision_vhost_config($url, $data) {
-  return "# Configur ITK permissions\nAssignUserID ". $data['web_user'] . ' #' . $data['web_group'] . "\n";
+function provision_itk_provision_vhost_config($url) {
+  return "# Configur ITK permissions\nAssignUserID ". drush_get_option('web_user') . ' #' . drush_get_option('web_group') . "\n";
 }
Index: platform/backup.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/backup.provision.inc,v
retrieving revision 1.4
diff -u -r1.4 backup.provision.inc
--- platform/backup.provision.inc	22 Feb 2009 23:11:24 -0000	1.4
+++ platform/backup.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -9,43 +9,45 @@
 /**
  * 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(&$data, $url = NULL, $backup_file = NULL) {
+function provision_drupal_provision_backup_validate($url = NULL, $backup_file = NULL) {
   _provision_drupal_url_required();
   _provision_drupal_valid_installed_site();
 
   // This is the actual drupal provisioning requirements. 
-  if (!is_dir(PROVISION_BACKUP_PATH)) {
+  if (!is_dir(drush_get_option('backup_path'))) {
     drush_set_error(PROVISION_BACKUP_PATH_NOT_FOUND);
   }
-  
+
   if ($backup_file) {
     if ( provision_path("exists", $backup_file, FALSE,
             dt("Backing site up to @path."),
             dt("Back up file @path already exists."),
         PROVISION_BACKUP_ALREADY_EXISTS)) {
-      $data['backup_file'] = $backup_file;
+      drush_get_option('backup_file', $backup_file);
     }
   }
+
   if (!$backup_file) {
-    $suggested = PROVISION_BACKUP_PATH ."/$url-". date("Y-m-d", mktime()) .".tar";
+    $suggested = drush_get_option('backup_path') ."/$url-". date("Y-m-d", mktime()) .".tar";
 
     // Use format of mysite.com-2008-01-02, if already existing, add number.
     while (is_file($suggested .'.gz')) {
       $count++;
-      $suggested = PROVISION_BACKUP_PATH ."/$url-". date("Y-m-d", mktime()) ."_$count.tar";
+      $suggested = drush_get_option('backup_path') ."/$url-". date("Y-m-d", mktime()) ."_$count.tar";
     }
 
-    $data['backup_file'] = (!empty($file)) ? ereg_replace('.gz$', '', $file) : $suggested;
+    drush_set_option('backup_file', str_replace(".gz" , '', $suggested));
   }
 }
 
 /**
  * Implentation of hook_provision_backup()
  */
-function provision_drupal_provision_backup(&$data, $url, $backup_file) {
+function provision_drupal_provision_backup($url) {
+  $backup_file = drush_get_option('backup_file');
   // Adds the site directory into the backup file
-  drush_log("Adding sites directory to $data[backup_file].gz", 'backup');
-  $result = provision_shell_exec("cd %s; tar -rf %s * ", "sites/$url",  $data['backup_file']);
+  drush_log(dt("Adding sites directory to !backup_file", array('!backup_file' => $backup_file)), 'backup');
+  $result = provision_shell_exec("cd %s; tar -rf %s * ", drush_get_option('sites_path') . "/$url",  $backup_file);
 
   if (!$result) {
     drush_set_error(PROVISION_BACKUP_FAILED, dt("Could not back up sites directory for drupal"));
@@ -56,7 +58,9 @@
 /**
  * Generate a backup tarbal for a site.
  */
-function provision_drupal_provision_post_backup(&$data, $url, $backup_file = NULL) {
-  provision_shell_exec("gzip %s", $data['backup_file']);
-  $data['backup_file'] = $data['backup_file'] .'.gz';
+function provision_drupal_provision_post_backup($url, $backup_file = NULL) {
+  $backup_file = drush_get_option('backup_file');
+
+  provision_shell_exec("gzip %s", $backup_file);
+  drush_set_option('backup_file', $backup_file . '.gz');
 }
Index: platform/cron.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/cron.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 cron.provision.inc
--- platform/cron.provision.inc	9 Dec 2008 02:17:48 -0000	1.1
+++ platform/cron.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -12,7 +12,7 @@
 /**
  * Drush command to run cron
  */
-function _provision_cron(&$data, $url) {
+function _provision_cron($url) {
   _provision_drupal_rebuild_caches($url);
 }
 
Index: platform/delete.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/delete.provision.inc,v
retrieving revision 1.2
diff -u -r1.2 delete.provision.inc
--- platform/delete.provision.inc	3 Feb 2009 01:23:34 -0000	1.2
+++ platform/delete.provision.inc	19 Mar 2009 15:49:26 -0000
@@ -1,7 +1,7 @@
 <?php
 
 
-function provision_drupal_provision_delete_validate(&$data, $url = NULL, $backup_file = NULL) {
+function provision_drupal_provision_delete_validate($url = NULL, $backup_file = NULL) {
   _provision_drupal_valid_site();
 }
 
@@ -9,24 +9,24 @@
 /**
  * Before starting to delete the site, make a backup
  */
-function provision_drupal_provision_pre_delete(&$data, $url, $backup_file) {
+function provision_drupal_provision_pre_delete($url, $backup_file) {
   // @TODO : fix the inline calling of provision_invoke
-  provision_invoke('backup', $data, $url, $backup_file);
+  provision_invoke('backup', $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(&$data, $url) {
-  if ($old_data = provision_load_site_data($url)) {
-    if (sizeof($old_aliases = $old_data['aliases'])) {
-      _provision_drupal_delete_aliases($old_aliases);
-    }
+function provision_drupal_provision_delete($url) {
+  $old_aliases = drush_get_option('aliases', array(), 'site');
+
+  if (sizeof($old_aliases) == sizeof(drush_get_option('aliases'))) {
+    _provision_drupal_delete_aliases($old_aliases);
   }
 
-  _provision_recursive_delete("sites/$url");
-  $data['installed'] = FALSE;
+  _provision_recursive_delete(drush_get_option('sites_path') . "/$url");
+  drush_set_option('installed', FALSE, 'site');
 }
 
 
Index: platform/deploy.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/deploy.provision.inc,v
retrieving revision 1.7
diff -u -r1.7 deploy.provision.inc
--- platform/deploy.provision.inc	22 Feb 2009 23:11:24 -0000	1.7
+++ platform/deploy.provision.inc	19 Mar 2009 15:49:27 -0000
@@ -23,7 +23,7 @@
 /**
  * Make sure we have a valid site being deployd, and that the file being deployd from exists
  */
-function provision_drupal_provision_deploy_validate(&$data, $url = null, $backup_file = null) {
+function provision_drupal_provision_deploy_validate($url = null, $backup_file = null) {
   _provision_drupal_url_required();
   _provision_drupal_valid_not_installed_site();
 
@@ -32,46 +32,46 @@
       dt("Could not find backup file @path"),
       PROVISION_BACKUP_NOT_FOUND);
   if ($exists) {
-    $data['backup_file'] = $backup_file;
+    drush_set_option('backup_file', $backup_file);
   }
 }
 
 /**
  * Make a backup before making any changes, and add extract the file we are restoring from
  */
-function provision_drupal_provision_pre_deploy(&$data, $url, $backup_file) {
-  $extracted = provision_path("extract", $data['backup_file'], PROVISION_SITES_PATH ."/$url", 
+function provision_drupal_provision_pre_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'),
     PROVISION_BACKUP_EXTRACTION_FAILED);
   if ($extracted) {
-    $old_data = provision_get_site_data($url);
-    $data['old_site_url'] = $old_data['site_url'];
-    $data = array_merge($old_data, $data); 
+    // @TODO Clear up this properly.
+//    $old_data = provision_get_site_data($url);
+//    $data = array_merge($old_data, $data); 
   }
 }
 
 /**
  * Remove the extracted site directory
  */
-function provision_provision_pre_deploy_rollback(&$data, $url) {
-  _provision_recursive_delete(PROVISION_SITES_PATH ."/$url");
+function provision_provision_pre_deploy_rollback($url) {
+  _provision_recursive_delete(drush_get_option('sites_path') ."/$url");
 }
 
 /**
  * Switch the deploy directories around now that we have the new db installed
  */
-function provision_drupal_provision_deploy(&$data, $url) {
+function provision_drupal_provision_deploy($url) {
   // make sure it has the latest site data available
-  _provision_drupal_create_settings_file($data, $url);
+  _provision_drupal_create_settings_file($url);
 }
 
 // Luckily this is reversable =)
-function provision_drupal_provision_deploy_rollback(&$data, $url) {
-  provision_drupal_provision_deploy(&$data, $url);
+function provision_drupal_provision_deploy_rollback($url) {
+  provision_drupal_provision_deploy($url);
 }
 
-function provision_drupal_provision_post_deploy(&$data, $url) {
-  provision_invoke('update', $data, $url);
-  provision_platform_include($data, dirname(__FILE__), 'deploy');
+function provision_drupal_provision_post_deploy($url) {
+  provision_invoke('update', $url);
+  provision_platform_include(dirname(__FILE__), 'deploy');
 }
Index: platform/disable.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/disable.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 disable.provision.inc
--- platform/disable.provision.inc	9 Dec 2008 02:17:48 -0000	1.1
+++ platform/disable.provision.inc	19 Mar 2009 15:49:27 -0000
@@ -19,14 +19,14 @@
 /**
  * Make a backup of the site before we mess with it
  */
-function provision_drupal_provision_pre_disable(&$data, $url, $backup_file = null) {
-  provision_invoke("backup", $data, $url, $backup_file);
+function provision_drupal_provision_pre_disable($url, $backup_file = null) {
+  provision_invoke("backup", $url, $backup_file);
 }
 
 /**
  * Set the enabled property of the site to false
  */
-function provision_drupal_provision_post_disable(&$data) {
-  $data['enabled'] = FALSE;
+function provision_drupal_provision_post_disable() {
+  drush_set_option('enabled', FALSE, 'site');
 }
 
Index: platform/drupal_5_import.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_5_import.inc,v
retrieving revision 1.1
diff -u -r1.1 drupal_5_import.inc
--- platform/drupal_5_import.inc	4 Feb 2009 14:09:28 -0000	1.1
+++ platform/drupal_5_import.inc	19 Mar 2009 15:49:27 -0000
@@ -5,16 +5,16 @@
 }
 
 if ($parts = @parse_url($db_url)) {
-  $data['db_type'] = $parts['scheme'];
-  $data['db_user'] = $parts['user'];
-  $data['db_host'] = $parts['host'];
-  $data['db_passwd'] = $parts['pass'];
-  $data['db_name'] = substr($parts['path'], 1);
+  drush_set_option('db_type', $parts['scheme'], 'site');
+  drush_set_option('db_user', $parts['user'], 'site');
+  drush_set_option('db_host', $parts['host'], 'site');
+  drush_set_option('db_passwd', $parts['pass'], 'site');
+  drush_set_option('db_name', substr($parts['path'], 1), 'site');
 
-  $data['profile'] = variable_get('install_profile', 'default');
+  drush_set_option('profile', variable_get('install_profile', 'default'), 'site');
   $has_locale = db_result(db_query("SELECT status FROM {system} WHERE type='module' AND name='locale'"));
   if ($has_locale) {
     $locale = db_result(db_query("SELECT locale FROM {locales_meta} WHERE isdefault=1 AND enabled=1"));
   }
-  $data['language'] = ($locale) ? ($locale) : 'en';
+  drush_set_option('language', $locale, 'site');
 }
Index: platform/drupal_5_install.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_5_install.inc,v
retrieving revision 1.2
diff -u -r1.2 drupal_5_install.inc
--- platform/drupal_5_install.inc	22 Feb 2009 22:43:57 -0000	1.2
+++ platform/drupal_5_install.inc	19 Mar 2009 15:49:27 -0000
@@ -4,10 +4,10 @@
  *    Rebuild all the caches
  */
 
-$GLOBALS['url'] = $data['site_url'];
-$GLOBALS['profile'] = $data['profile'];
-$GLOBALS['install_locale'] = $data['language'];
-$GLOBALS['client_email'] = $data['client_email'];
+$GLOBALS['url'] = drush_get_option('site_url');
+$GLOBALS['profile'] = drush_get_option('profile');
+$GLOBALS['install_locale'] = drush_get_option('language');
+$GLOBALS['client_email'] = drush_get_option('client_email');
 
 require_once 'includes/install.inc';
 
Index: platform/drupal_6_import.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_6_import.inc,v
retrieving revision 1.1
diff -u -r1.1 drupal_6_import.inc
--- platform/drupal_6_import.inc	4 Feb 2009 14:09:28 -0000	1.1
+++ platform/drupal_6_import.inc	19 Mar 2009 15:49:27 -0000
@@ -1,13 +1,13 @@
 <?php
 
 if ($parts = @parse_url($GLOBALS['db_url'])) {
-  $data['db_type'] = $parts['scheme'];
-  $data['db_user'] = $parts['user'];
-  $data['db_host'] = $parts['host'];
-  $data['db_passwd'] = $parts['pass'];
-  $data['db_name'] = substr($parts['path'], 1);
+  drush_set_option('db_type', $parts['scheme'], 'site');
+  drush_set_option('db_user', $parts['user'], 'site');
+  drush_set_option('db_host', $parts['host'], 'site');
+  drush_set_option('db_passwd', $parts['pass'], 'site');
+  drush_set_option('db_name', substr($parts['path'], 1), 'site');
 
-  $data['profile'] = variable_get('install_profile', 'default');
+  drush_set_option('profile', variable_get('install_profile', 'default'), 'site');
   $language = language_default();
-  $data['language'] = $language->language;
+  drush_set_option('language', $language->language, 'site');
 }
Index: platform/drupal_6_install.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_6_install.inc,v
retrieving revision 1.2
diff -u -r1.2 drupal_6_install.inc
--- platform/drupal_6_install.inc	22 Feb 2009 22:43:57 -0000	1.2
+++ platform/drupal_6_install.inc	19 Mar 2009 15:49:27 -0000
@@ -4,10 +4,10 @@
  *    Rebuild all the caches
  */
 
-$GLOBALS['url'] = $data['site_url'];
-$GLOBALS['profile'] = $data['profile'];
-$GLOBALS['install_locale'] = $data['language'];
-$GLOBALS['client_email'] = $data['client_email'];
+$GLOBALS['url'] = drush_get_option('site_url');
+$GLOBALS['profile'] = drush_get_option('profile');
+$GLOBALS['install_locale'] = drush_get_option('language');
+$GLOBALS['client_email'] = drush_get_option('client_email');
 
 require_once 'includes/install.inc';
 define('MAINTENANCE_MODE', 'install');
Index: platform/drupal_7_import.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_7_import.inc,v
retrieving revision 1.1
diff -u -r1.1 drupal_7_import.inc
--- platform/drupal_7_import.inc	4 Feb 2009 14:09:28 -0000	1.1
+++ platform/drupal_7_import.inc	19 Mar 2009 15:49:27 -0000
@@ -1,13 +1,13 @@
 <?php
 global $databases;
 if ($db = $databases['default']['default']) {
-  $data['db_type'] = $db['driver'];
-  $data['db_user'] = $db['username'];
-  $data['db_host'] = $db['host'];
-  $data['db_passwd'] = $db['password'];
-  $data['db_name'] = $db['database'];
+  drush_set_option('db_type', $db['driver'], 'site');
+  drush_set_option('db_user', $db['username'], 'site');
+  drush_set_option('db_host', $db['host'], 'site');
+  drush_set_option('db_passwd', $db['password'], 'site');
+  drush_set_option('db_name', $db['database'], 'site');
 
-  $data['profile'] = variable_get('install_profile', 'default');
+  drush_set_option('profile', variable_get('install_profile', 'default'), 'site');
   $language = language_default();
-  $data['language'] = $language->language;
+  drush_set_option('language', $language->language, 'site');
 }
Index: platform/drupal_7_install.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_7_install.inc,v
retrieving revision 1.5
diff -u -r1.5 drupal_7_install.inc
--- platform/drupal_7_install.inc	22 Feb 2009 22:43:57 -0000	1.5
+++ platform/drupal_7_install.inc	19 Mar 2009 15:49:28 -0000
@@ -4,10 +4,10 @@
  *    Rebuild all the caches
  */
 
-$GLOBALS['url'] = $data['site_url'];
-$GLOBALS['profile'] = $data['profile'];
-$GLOBALS['install_locale'] = $data['language'];
-$GLOBALS['client_email'] = $data['client_email'];
+$GLOBALS['url'] = drush_get_option('site_url');
+$GLOBALS['profile'] = drush_get_option('profile');
+$GLOBALS['install_locale'] = drush_get_option('language');
+$GLOBALS['client_email'] = drush_get_option('client_email');
 
 require_once 'includes/install.inc';
 define('MAINTENANCE_MODE', 'install');
Index: platform/drupal_deploy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_deploy.inc,v
retrieving revision 1.3
diff -u -r1.3 drupal_deploy.inc
--- platform/drupal_deploy.inc	25 Feb 2009 17:08:12 -0000	1.3
+++ platform/drupal_deploy.inc	19 Mar 2009 15:49:28 -0000
@@ -1,8 +1,8 @@
 <?php
 // $Id: drupal_deploy.inc,v 1.3 2009/02/25 17:08:12 adrian Exp $
 
-$new_url = $data['site_url'];
-$old_url = $data['old_site_url'];
+$new_url = drush_get_option('site_url');
+$old_url = drush_get_option('old_site_url');
 
 
 /**
Index: platform/drupal_verify.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/drupal_verify.inc,v
retrieving revision 1.1
diff -u -r1.1 drupal_verify.inc
--- platform/drupal_verify.inc	4 Feb 2009 14:09:28 -0000	1.1
+++ platform/drupal_verify.inc	19 Mar 2009 15:49:28 -0000
@@ -1,8 +1,8 @@
 <?php
 // $Id: drupal_verify.inc,v 1.1 2009/02/04 14:09:28 adrian Exp $
 
-$data['modules'] = module_rebuild_cache();
+drush_set_option('modules', _scrub_object(module_rebuild_cache()), 'site');
 // Find theme engines
-$data['engines'] = drupal_system_listing('\.engine$', 'themes/engines');
-$data['themes'] = system_theme_data();
+drush_set_option('engines', _scrub_object(drupal_system_listing('\.engine$', 'themes/engines')), 'site');
+drush_set_option('themes', _scrub_object(system_theme_data()), 'site');
 
Index: platform/enable.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/enable.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 enable.provision.inc
--- platform/enable.provision.inc	9 Dec 2008 02:17:48 -0000	1.1
+++ platform/enable.provision.inc	19 Mar 2009 15:49:28 -0000
@@ -10,8 +10,8 @@
   _provision_drupal_valid_installed_site();
 }
 
-function provision_drupal_post_enable(&$data) {
-  $data['enabled'] = TRUE;
+function provision_drupal_post_enable() {
+  drush_set_option('enabled', TRUE, 'site');
 }
 
 
Index: platform/import.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/import.provision.inc,v
retrieving revision 1.3
diff -u -r1.3 import.provision.inc
--- platform/import.provision.inc	4 Feb 2009 16:16:14 -0000	1.3
+++ platform/import.provision.inc	19 Mar 2009 15:49:28 -0000
@@ -17,8 +17,8 @@
 /**
  * Import the information about the existing site, and return it in the $data context array
  */
-function provision_drupal_provision_import(&$data, $url = NULL) {
+function provision_drupal_provision_import($url = NULL) {
   provision_internal_init($url);
-  provision_platform_include($data, dirname(__FILE__), 'import');
+  provision_platform_include(dirname(__FILE__), 'import');
 }
 
Index: platform/install.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/install.provision.inc,v
retrieving revision 1.5
diff -u -r1.5 install.provision.inc
--- platform/install.provision.inc	12 Mar 2009 18:28:57 -0000	1.5
+++ platform/install.provision.inc	19 Mar 2009 15:49:28 -0000
@@ -22,9 +22,9 @@
 /**
  * Set up the directories and settings.php file that we need.
  */
-function provision_drupal_provision_pre_install(&$data, $url = NULL) {
+function provision_drupal_provision_pre_install($url) {
  // This is the actual drupal provisioning requirements. 
- _provision_drupal_create_directories($url, $data['profile']);
+ _provision_drupal_create_directories($url);
 }
 
 /**
@@ -33,17 +33,17 @@
  * 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(&$data, $url = NULL) {
+function provision_drupal_provision_install($url) {
  // Requires at least the database settings to complete.
-  _provision_drupal_create_settings_file($data, $url);
+  _provision_drupal_create_settings_file($url);
   provision_internal_init($url, FALSE);
-  provision_platform_include($data, dirname(__FILE__), 'install');
+  provision_platform_include(dirname(__FILE__), 'install');
 }
 
 /**
  * If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
  */
-function provision_drupal_provision_install_rollback(&$data, $url = NULL) {
+function provision_drupal_provision_install_rollback($url) {
   if (!(drush_get_error() & PROVISION_SITE_INSTALLED)) {
     _provision_recursive_delete("sites/$url");
   }
@@ -54,10 +54,10 @@
  * 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(&$data, $url = NULL) {
-  $data['installed'] = TRUE;
-  _provision_drupal_maintain_aliases($url, $data);
+function provision_drupal_provision_post_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"));
-  _provision_drupal_rebuild_caches($data, $url);
+  _provision_drupal_rebuild_caches($url);
 }
 
Index: platform/migrate.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/migrate.provision.inc,v
retrieving revision 1.5
diff -u -r1.5 migrate.provision.inc
--- platform/migrate.provision.inc	5 Mar 2009 19:05:10 -0000	1.5
+++ platform/migrate.provision.inc	19 Mar 2009 15:49:28 -0000
@@ -23,7 +23,7 @@
 /**
  * Make sure we have a valid site being migrated, and that the file being migrated from exists
  */
-function provision_drupal_provision_migrate_validate(&$data, $url = null, $platform = null) {
+function provision_drupal_provision_migrate_validate($url = null, $platform = null) {
   _provision_drupal_url_required();
   _provision_drupal_valid_installed_site();
 }
@@ -31,34 +31,31 @@
 /**
  * Make a backup before making any changes, and add extract the file we are restoring from
  */
-function provision_drupal_provision_pre_migrate(&$data, $url, $platform) {
-  provision_invoke('backup', &$data, $url);
+function provision_drupal_provision_pre_migrate($url, $platform) {
+  provision_invoke('backup', $url);
 }
 
 /**
  * Remove the extracted site directory
  */
-function provision_provision_pre_migrate_rollback(&$data, $url, $platform) {
-  $success =  provision_path("unlink", $data['backup_file'], TRUE, dt('Removed unused migration site package'), dt('Could not remove unused migration site package'));
-  if ($success) {
-    unset($data['backup_file']);
-  }
+function provision_provision_pre_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(&$data, $url, $platform) {
-  drush_backend_invoke('provision deploy', array($url, $data['backup_file'], 'root' => $platform));
+function provision_drupal_provision_migrate($url, $platform) {
+  drush_backend_invoke('provision deploy', array($url, drush_get_option('backup_file'), 'root' => $platform));
 }
 
 
 /**
  * Delete the old site directory and recreate the settings file
  */
-function provision_drupal_provision_post_migrate(&$data, $url) {
-  $data['installed'] = FALSE;
-  _provision_recursive_delete(PROVISION_SITES_PATH ."/$url");
+function provision_drupal_provision_post_migrate($url) {
+  drush_set_option('installed', FALSE);
+  _provision_recursive_delete(drush_get_option('sites_path') ."/$url");
 }
 
 
Index: platform/provision_drupal.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/provision_drupal.drush.inc,v
retrieving revision 1.12
diff -u -r1.12 provision_drupal.drush.inc
--- platform/provision_drupal.drush.inc	5 Mar 2009 19:05:10 -0000	1.12
+++ platform/provision_drupal.drush.inc	19 Mar 2009 15:49:29 -0000
@@ -46,10 +46,10 @@
  * This function is executed by provision_invoke, and is responsible
  * for populating the $data context array
  */
-function provision_drupal_provision_init(&$data, $url = NULL) {
+function provision_drupal_provision_init($url = NULL) {
   if ($url) {
-    define('PROVISION_ACTIVE_URL', $url);
-    $data = provision_get_site_data($url); // load the existing site's context into the system.
+    drush_set_option('site_url', $url);
+    provision_get_site_data($url); // load the existing site's context into the system.
   }
   define('PROVISION_CONTEXT_SITE', ($url) ? TRUE : FALSE);
   define('PROVISION_CONTEXT_PLATFORM', !PROVISION_CONTEXT_SITE);
@@ -62,10 +62,11 @@
  * and will allow us to cache the successful settings to the site.php/ drushrc.php
  * files for future runs.
  */
-function provision_drupal_provision_finalize(&$data, $url = NULL) {
+function provision_drupal_provision_finalize($url = NULL) {
   if (PROVISION_CONTEXT_SITE) {
-    if ($data['installed']) {
-      provision_save_site_data($data, $url);
+    if (drush_get_option('installed')) {
+      drush_set_option('site_url', drush_get_option('site_url'), 'site');
+      provision_save_site_data($url);
     }
   }
   else {
@@ -90,7 +91,7 @@
  */
 function _provision_drupal_valid_site() {
   if (PROVISION_CONTEXT_SITE) {
-    if (!_provision_drupal_site_exists(PROVISION_ACTIVE_URL)) {
+    if (!_provision_drupal_site_exists(drush_get_option('site_url'))) {
       drush_set_error(PROVISION_DRUPAL_SITE_NOT_FOUND);
     }
   }
@@ -116,7 +117,7 @@
  */
 function _provision_drupal_valid_installed_site() {
   if (PROVISION_CONTEXT_SITE) {
-    if (!_provision_drupal_site_installed(PROVISION_ACTIVE_URL)) {
+    if (!_provision_drupal_site_installed(drush_get_option('site_url'))) {
       drush_set_error(PROVISION_DRUPAL_SITE_NOT_FOUND);
     }
   }
@@ -124,7 +125,7 @@
 
 function _provision_drupal_valid_not_installed_site() {
   if (PROVISION_CONTEXT_SITE) {
-    if (_provision_drupal_site_installed(PROVISION_ACTIVE_URL)) {
+    if (_provision_drupal_site_installed(drush_get_option('site_url'))) {
       drush_set_error(PROVISION_DRUPAL_SITE_INSTALLED);
     }
   }
@@ -135,9 +136,8 @@
  */
 function _provision_drupal_site_installed($url) {
   if (_provision_drupal_site_exists($url)) {
-    if ($data = provision_load_site_data($url)) {
-      return isset($data['installed']) ? $data['installed'] : FALSE;
-    }
+    provision_load_site_data($url);
+    return drush_get_option('installed');
   }
   return FALSE;
 }
@@ -161,7 +161,16 @@
  *   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.
  */
-function _provision_drupal_create_settings_file(&$data, $url = NULL) {
+function _provision_drupal_create_settings_file($url = NULL) {
+  $options = drush_get_merged_options();
+
+  $options['extra_config'] = "# Extra configuration from modules:\n";
+  foreach (drush_command_implements('provision_drupal_config') as $module) {
+    $options['extra_config'] .= "# -- $module settings --\n";
+    $options['extra_config'] .= module_invoke($module, 'provision_drupal_config', $url) . "\n";
+  }
+
+
   drush_log(dt("Generate settings.php file"));
   if (provision_path("exists", "sites/$url/settings.php")) {
     provision_path("chmod", "sites/$url/settings.php", 0640,
@@ -169,24 +178,17 @@
       dt('Could not change permissions of settings.php to @confirm'));
   }
 
-  $data['extra_config'] = "# Extra configuration from modules:\n";
-  foreach (drush_command_implements('provision_drupal_config') as $module) {
-    $data['extra_config'] .= "# -- $module settings --\n";
-    $data['extra_config'] .= module_invoke($module, 'provision_drupal_config', $url, $data) . "\n";
-  }
-
-
   $fp = fopen("sites/$url/settings.php", "w");
   $text =  _provision_drupal_default_template();
-  fwrite($fp, "<?php\n". provision_render_config($text, $data));
+  fwrite($fp, "<?php\n". provision_render_config($text, $options));
   fclose($fp);
 
   # Change the permissions of the file
   provision_path("chmod", "sites/$url/settings.php", 0440,
     dt('Changed permissions of settings.php to @confirm'),
     dt('Could not change permissions of settings.php to @confirm'));
-  $group = $data['web_group'] ? $data['web_group'] : PROVISION_WEB_GROUP;
-  provision_path("chgrp", "sites/$url/settings.php", $group,
+
+  provision_path("chgrp", "sites/$url/settings.php", drush_get_option('web_group'),
     dt('Change group ownership of settings.php to @confirm'),
     dt('Could not change group ownership of settings.php to @confirm'));
 }
@@ -227,11 +229,11 @@
       DRUSH_PERM_ERROR);
   }
   foreach ($grps as $path) {
-      provision_path("chown", $path, PROVISION_SCRIPT_USER, 
+      provision_path("chown", $path, drush_get_option('script_user'), 
       dt("Changed ownership of <code>@path</code>"),
       dt("Could not change ownership <code>@path</code>"),
       DRUSH_PERM_ERROR );
-    provision_path("chgrp", $path, PROVISION_WEB_GROUP,
+    provision_path("chgrp", $path, drush_get_option('web_group'),
       dt("Changed group ownership of <code>@path</code>"),
       dt("Could not change group ownership <code>@path</code>"));
   }
@@ -240,10 +242,10 @@
 /**
  * Runs an external script to reload all the various drupal caches
  */
-function _provision_drupal_rebuild_caches(&$data, $url = NULL) {
+function _provision_drupal_rebuild_caches($url = NULL) {
   if (PROVISION_CONTEXT_SITE) {
     provision_internal_init($url);
-    provision_platform_include($data, dirname(__FILE__), 'clear');
+    provision_platform_include(dirname(__FILE__), 'clear');
   }
 }
 
@@ -330,28 +332,24 @@
 /**
  * Create and remove symlinks for each of the possible domain aliases of an existing site
  */
-function _provision_drupal_maintain_aliases($data, $url) {
+function _provision_drupal_maintain_aliases($url) {
   if (PROVISION_CONTEXT_SITE) {
-    $old_aliases = array();
-    if ($old_data = provision_load_site_data($url)) {
-      if (is_array($old_data['aliases'])) {
-         // Flip the array to make it easier to remove duplicates
-        $old_aliases = array_flip($old_data['aliases']);
-      }
+    $old_aliases = drush_get_option('aliases', array(), 'site');
+    /**
+     * First we remove all the old aliases
+     */
+    if (is_array($old_aliases)) {
+      _provision_drupal_delete_aliases($old_aliases);
     }
-   
-    if (is_array($data['aliases'])) {
-      foreach($data['aliases'] as $alias) {
-        if (isset($old_aliases[$alias])) {
-          // We have already created an alias for this site.
-          unset($old_aliases[$alias]);
-        }
-        provision_path("symlink", $url, PROVISION_DOCROOT_PATH . "/sites/" . $alias, 
+
+
+    $aliases = drush_get_option('aliases');
+    if (is_array($aliases)) {
+      foreach($aliases as $alias) {
+        provision_path("symlink", $url, drush_get_option('docroot_path') . "/sites/" . $alias, 
           dt("Created symlink for alias @alias", array("@alias" => $alias)), 
           dt("Could not create symlink for alias @alias", array("@alias" => $alias)));
       }
-      // Delete existing aliases that are no longer present
-      _provision_drupal_delete_aliases(array_keys($old_aliases));
     }
   }
 }
@@ -361,7 +359,7 @@
  */
 function _provision_drupal_delete_aliases($aliases) {
   foreach ($aliases as $alias) {
-    provision_path("unlink", PROVISION_DOCROOT_PATH . "/sites/" . $alias, TRUE,
+    provision_path("unlink", drush_get_option('docroot_path') . "/sites/" . $alias, TRUE,
           dt("Removed symlink for alias @alias", array("@alias" => $alias)), 
           dt("Could not remove symlink for alias @alias", array("@alias" => $alias)));
   }
Index: platform/provision_drupal_settings.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/provision_drupal_settings.tpl.php,v
retrieving revision 1.11
diff -u -r1.11 provision_drupal_settings.tpl.php
--- platform/provision_drupal_settings.tpl.php	4 Feb 2009 14:09:28 -0000	1.11
+++ platform/provision_drupal_settings.tpl.php	19 Mar 2009 15:49:29 -0000
@@ -57,6 +57,6 @@
   }
 
   # Additional host wide configuration settings. Useful for safely specifying configuration settings.
-  if (file_exists('<?php print PROVISION_CONFIG_PATH . '/' ?>includes/global.inc')) {
-    include_once('<?php print PROVISION_CONFIG_PATH . '/' ?>includes/global.inc');
+  if (file_exists('<?php print $config_path  ?>/includes/global.inc')) {
+    include_once('<?php print $config_path  ?>/includes/global.inc');
   }
Index: platform/restore.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/restore.provision.inc,v
retrieving revision 1.4
diff -u -r1.4 restore.provision.inc
--- platform/restore.provision.inc	5 Mar 2009 21:05:41 -0000	1.4
+++ platform/restore.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -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(&$data, $url = null, $restore_file = null) {
+function provision_drupal_provision_restore_validate($url = null, $restore_file = null) {
   _provision_drupal_url_required();
   _provision_drupal_valid_installed_site();
 
@@ -32,17 +32,17 @@
       dt("Could not find backup file @path"),
       PROVISION_BACKUP_NOT_FOUND);
   if ($exists) {
-    $data['restore_file'] = $restore_file;
+    drush_set_option('restore_file', $restore_file);
   }
 }
 
 /**
  * Make a backup before making any changes, and add extract the file we are restoring from
  */
-function provision_drupal_provision_pre_restore(&$data, $url, $restore_file) {
-  provision_invoke('backup', &$data, $url);
+function provision_drupal_provision_pre_restore($url, $restore_file) {
+  provision_invoke('backup', $url);
 
-  provision_path("extract", $data['restore_file'], PROVISION_SITES_PATH ."/$url.restore", 
+  provision_path("extract", drush_get_option('restore_file'), drush_get_option('sites_path') ."/$url.restore", 
     dt('Successfully extracted the contents of @path'),
     dt('Failed to extract the contents of @path'),
     PROVISION_BACKUP_EXTRACTION_FAILED);
@@ -51,36 +51,36 @@
 /**
  * Remove the extracted site directory
  */
-function provision_drupal_provision_pre_restore_rollback(&$data, $url) {
-  _provision_recursive_delete(PROVISION_SITES_PATH ."/$url.restore");
+function provision_drupal_provision_pre_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(&$data, $url) {
-  $old = PROVISION_SITES_PATH ."/$url.restore";
-  $new = PROVISION_SITES_PATH ."/$url";
+function 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 ,
     dt('Swapping out the @path and @confirm directories was successful.'),
     dt('Swapping the @path and @confirm directories has failed.'),
     DRUSH_PERM_ERROR);
   // make sure it has the latest site data available
-  _provision_drupal_create_settings_file($data, $url);
-  provision_save_site_data($data, $url);
+  _provision_drupal_create_settings_file($url);
+  provision_save_site_data($url);
 }
 
 // Luckily this is reversable =)
-function provision_drupal_provision_restore_rollback(&$data, $url) {
-  provision_drupal_provision_restore(&$data, $url);
+function provision_drupal_provision_restore_rollback($url) {
+  provision_drupal_provision_restore($url);
 }
 
 /**
  * Delete the old site directory and recreate the settings file
  */
-function provision_drupal_provision_post_restore(&$data, $url) {
-  _provision_recursive_delete(PROVISION_SITES_PATH ."/$url.restore");
-  _provision_drupal_create_settings_file($data, $url);
+function provision_drupal_provision_post_restore($url) {
+  _provision_recursive_delete(drush_get_option('sites_path') ."/$url.restore");
+  _provision_drupal_create_settings_file($url);
 }
 
 
Index: platform/update.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/update.provision.inc,v
retrieving revision 1.5
diff -u -r1.5 update.provision.inc
--- platform/update.provision.inc	4 Feb 2009 16:16:14 -0000	1.5
+++ platform/update.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -5,9 +5,9 @@
   _provision_drupal_valid_installed_site();
 }
 
-function provision_drupal_provision_update(&$data, $url) {
-  _provision_drupal_create_settings_file($data, $url);
-  provision_internal_init($data['site_url'], false);
-  provision_platform_include($data, dirname(__FILE__), 'update');
-  provision_platform_include($data, dirname(__FILE__), 'clear');
+function provision_drupal_provision_update($url) {
+  _provision_drupal_create_settings_file($url);
+  provision_internal_init($url, false);
+  provision_platform_include(dirname(__FILE__), 'update');
+  provision_platform_include(dirname(__FILE__), 'clear');
 }
Index: platform/verify.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/platform/verify.provision.inc,v
retrieving revision 1.6
diff -u -r1.6 verify.provision.inc
--- platform/verify.provision.inc	22 Feb 2009 23:11:24 -0000	1.6
+++ platform/verify.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -14,42 +14,44 @@
 /**
  * implementation of provision_verify
  */
-function provision_drupal_provision_verify(&$data, $url = null) {
+function provision_drupal_provision_verify($url = null) {
   if (PROVISION_CONTEXT_PLATFORM) {
-    _provision_create_dir(PROVISION_CONFIG_PATH, dt('Provision configuration'), 0700);
-    _provision_create_dir(PROVISION_BACKUP_PATH, dt('Web server configuration'), 0700);
-    provision_path("writable", "sites", TRUE, dt("Drupal sites directory is writable by the provisioning script"),
+    _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);
+    provision_path("writable", drush_get_option('sites_path'), TRUE, dt("Drupal sites directory is writable by the provisioning script"),
       dt("Drupal sites directory is not writable by the provisioning script"), PROVISION_SITES_DIR_NOT_WRITABLE);
-    $data['sites'] = array_keys((array) provision_drupal_find_sites()); // return list of hosted sites. used to determine whether or not to import. 
 
-    $data['platform'] = array('short_name' => 'drupal', 'version' => drush_drupal_version());  
+    drush_set_option('sites', array_keys((array) provision_drupal_find_sites()), 'platform'); 
+    drush_set_option('platform', array('short_name' => 'drupal', 'version' => drush_drupal_version()), 'platform'); 
+    print_r(_drush_get_context());
     drush_log(dt("This platform is running @short_name @version", 
       array('@short_name' => 'drupal', '@version' => VERSION)));
-    $data['profiles'] = _provision_find_profiles();
+    drush_set_option('profiles', _scrub_object(_provision_find_profiles()), 'platform');
+
   }
   else {
       // This is the actual drupal provisioning requirements. 
-    _provision_drupal_create_directories($url, $data['profile']);
-    _provision_drupal_maintain_aliases($data, $url);
+    _provision_drupal_create_directories($url);
+    _provision_drupal_maintain_aliases($url);
     // Requires at least the database settings to complete.
-    _provision_drupal_create_settings_file($data, $url);
-//    provision_internal_init($url);
-//    provision_platform_include($data, dirname(__FILE__), 'verify');
+   _provision_drupal_create_settings_file($url);
+    provision_internal_init($url);
+    provision_platform_include(dirname(__FILE__), 'verify');
   }
-  if (is_array($data['modules'])) {
+  #if (is_array($data['modules'])) {
     // get the correct version names for everything.
     #$data['modules'] = _provision_drupal_get_cvs_versions($data['modules']);
-  }
+  #}
 }
 
 
 /**
  * Implementation of hook_provision_post_verify
  */
-function provision_drupal_provision_post_verify(&$data, $url = NULL) {
+function provision_drupal_provision_post_verify($url = NULL) {
   if (PROVISION_CONTEXT_SITE) {
-    _provision_drupal_rebuild_caches($data, $url);
-    $data['installed'] = TRUE;
+    _provision_drupal_rebuild_caches($url);
+    drush_set_option('installed', TRUE, 'site');
   }
 }
 
Index: web_server/delete.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/delete.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 delete.provision.inc
--- web_server/delete.provision.inc	9 Dec 2008 02:17:49 -0000	1.1
+++ web_server/delete.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -1,7 +1,7 @@
 <?php
 
-function provision_apache_provision_delete(&$data, $url = NULL) {
-  _provision_apache_delete_vhost_config($url, $data);
+function provision_apache_provision_delete($url = NULL) {
+  _provision_apache_delete_vhost_config($url);
   return _provision_apache_restart_apache();  
 }
 
Index: web_server/deploy.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/deploy.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 deploy.provision.inc
--- web_server/deploy.provision.inc	3 Feb 2009 10:29:18 -0000	1.1
+++ web_server/deploy.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -3,19 +3,19 @@
 /**
  * Implementation of hook_provision_pre_deploy
  */
-function provision_apache_provision_pre_deploy(&$data, $url = NULL) {
-  _provision_apache_create_vhost_config($data, $url);
+function provision_apache_provision_pre_deploy($url = NULL) {
+  _provision_apache_create_vhost_config($url);
 }
 
-function provision_apache_provision_pre_deploy_rollback($data, $url = NULL) {
-  _provision_apache_delete_vhost_config($data, $url);
+function provision_apache_provision_pre_deploy_rollback($url = NULL) {
+  _provision_apache_delete_vhost_config($url);
 }
 
-function provision_apache_provision_post_deploy(&$data, $url = NULL) {
+function provision_apache_provision_post_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(&$data, $url = NULL) {
-  provision_apache_provision_post_deploy($data, $url);
+function provision_apache_provision_post_deploy_rollback($url = NULL) {
+  provision_apache_provision_post_deploy($url);
 }
Index: web_server/disable.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/disable.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 disable.provision.inc
--- web_server/disable.provision.inc	9 Dec 2008 02:17:49 -0000	1.1
+++ web_server/disable.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -3,9 +3,9 @@
 /**
  * Implementation of hook_provision_disable
  */
-function provision_apache_provision_disable(&$data, $url = NULL) {
-  $data['redirect_url'] = PROVISION_WEB_DISABLE_URL;
-  _provision_apache_create_vhost_config($data, $url, _provision_apache_redirect_template());
+function 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();
 }
 
Index: web_server/enable.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/enable.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 enable.provision.inc
--- web_server/enable.provision.inc	9 Dec 2008 02:17:49 -0000	1.1
+++ web_server/enable.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -3,8 +3,8 @@
 /**
  * Implementation of hook_provision_enable
  */
-function provision_apache_provision_enable(&$data, $url = NULL) {
-  _provision_apache_create_vhost_config($data, $url);
+function provision_apache_provision_enable($url = NULL) {
+  _provision_apache_create_vhost_config($url);
   _provision_apache_restart_apache();
 }
 
Index: web_server/install.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/install.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 install.provision.inc
--- web_server/install.provision.inc	9 Dec 2008 02:17:49 -0000	1.1
+++ web_server/install.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -10,14 +10,14 @@
 /**
  * Implementation of hook_provision_pre_install
  */
-function provision_apache_provision_pre_install(&$data, $url = NULL) {
-  return _provision_apache_create_vhost_config($data, $url);
+function provision_apache_provision_pre_install($url = NULL) {
+  return _provision_apache_create_vhost_config($url);
 }
 
 /**
  * Implementation of hook_provision_post_install
  */
-function provision_apache_provision_post_install(&$data, $url = NULL) {
+function provision_apache_provision_post_install($url = NULL) {
   return _provision_apache_restart_apache();  
 }
 
Index: web_server/provision_apache.drush.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/provision_apache.drush.inc,v
retrieving revision 1.5
diff -u -r1.5 provision_apache.drush.inc
--- web_server/provision_apache.drush.inc	22 Feb 2009 23:11:24 -0000	1.5
+++ web_server/provision_apache.drush.inc	19 Mar 2009 15:49:29 -0000
@@ -28,30 +28,31 @@
 /**
  * Delete virtual host file
  */
-function _provision_apache_delete_vhost_config($url, $data) {
-  provision_path("unlink", PROVISION_VHOST_PATH ."/$url", TRUE, dt("Removed apache virtual host configuration"));
+function _provision_apache_delete_vhost_config($url) {
+  provision_path("unlink", drush_get_option('vhost_path') ."/$url", TRUE, dt("Removed apache virtual host configuration"));
 }
 
 /**
  * Generate virtual host file
  */
-function _provision_apache_create_vhost_config($data, $url, $template = NULL) {
+function _provision_apache_create_vhost_config($url, $template = NULL) {
+  $options = drush_get_merged_options();
   if (is_null($template)) {
     $template = _provision_apache_default_template();
   }
   drush_log(dt("Generate virtual host configuration file."));
-  $writable = provision_path("writable", PROVISION_VHOST_PATH, TRUE , NULL,
+  $writable = provision_path("writable", drush_get_option('vhost_path'), TRUE , NULL,
       dt("Virtual host configuration path @path is not writable."), 
       PROVISION_VHOST_PATH_NOT_WRITABLE);
-  $data['extra_config'] = "# Extra configuration from modules:\n";
+  $options['extra_config'] = "# Extra configuration from modules:\n";
   foreach (drush_command_implements('provision_vhost_config') as $module) {
-    $data['extra_config'] .= "# -- $module settings --\n";
-    $data['extra_config'] .= module_invoke($module, 'provision_vhost_config', $url, $data) . "\n";
+    $options['extra_config'] .= "# -- $module settings --\n";
+    $options['extra_config'] .= module_invoke($module, 'provision_vhost_config', $url, $options) . "\n";
   }
   
   if ($writable) {
-    $file = fopen(PROVISION_VHOST_PATH .'/'. $url, "w");
-    $text = provision_render_config($template, $data);
+    $file = fopen(drush_get_option('vhost_path') .'/'. $url, "w");
+    $text = provision_render_config($template, $options);
     fwrite($file, $text);
     fclose($file);
   }
@@ -63,7 +64,7 @@
 function _provision_apache_restart_apache($cause_error = FALSE) {
   //This is required to be configurable, due to the fact that different hosts might need to do this differently.
   //TODO : test for this instead of relying on a configuration setting?
-  $return = drush_shell_exec(escapeshellcmd(PROVISION_RESTART_CMD));
+  $return = drush_shell_exec(escapeshellcmd(drush_get_option('restart_cmd')));
   if (!$return) {
     if ($cause_error) {
       return drush_set_error(PROVISION_WEB_RESTART_FAILED, dt("Web server could not be restarted. Changes might not be available until this has been done."));
Index: web_server/restore.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/restore.provision.inc,v
retrieving revision 1.1
diff -u -r1.1 restore.provision.inc
--- web_server/restore.provision.inc	9 Dec 2008 02:17:49 -0000	1.1
+++ web_server/restore.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -3,23 +3,23 @@
 /**
  * Implementation of hook_provision_pre_restore
  */
-function provision_apache_provision_pre_restore(&$data, $url = NULL) {
-  $data['redirect_url'] = PROVISION_WEB_MAINTENANCE_URL;
-  _provision_apache_create_vhost_config($data, $url, _provision_apache_redirect_template());
+function provision_apache_provision_pre_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($data, $url = NULL) {
-  _provision_apache_create_vhost_config($data, $url);
+function provision_apache_provision_pre_restore_rollback($url) {
+  _provision_apache_create_vhost_config($url);
   _provision_apache_restart_apache();
 }
 
-function provision_apache_provision_post_restore(&$data, $url = NULL) {
-  _provision_apache_create_vhost_config($data, $url);
+function provision_apache_provision_post_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(&$data, $url = NULL) {
-  provision_apache_provision_post_restore($data, $url);
+function provision_apache_provision_post_restore_rollback($url) {
+  provision_apache_provision_post_restore($url);
 }
Index: web_server/verify.provision.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/provision/web_server/verify.provision.inc,v
retrieving revision 1.3
diff -u -r1.3 verify.provision.inc
--- web_server/verify.provision.inc	14 Feb 2009 02:55:39 -0000	1.3
+++ web_server/verify.provision.inc	19 Mar 2009 15:49:29 -0000
@@ -1,12 +1,24 @@
 <?php
 
-function provision_apache_provision_verify($data, $url) {
+function provision_apache_provision_verify($url) {
   if (PROVISION_CONTEXT_PLATFORM) {
-    _provision_create_dir(PROVISION_VHOST_PATH, dt("Virtual host configuration"), 0700);
+    _provision_create_dir(drush_get_option('vhost_path'), dt("Virtual host configuration"), 0700);
   }
   else {
-    _provision_apache_create_vhost_config($data, $url);
+    _provision_apache_create_vhost_config($url);
   }
   _provision_apache_restart_apache(TRUE);
 }
 
+function provision_apache_provision_post_verify($url) {
+  if (PROVISION_CONTEXT_PLATFORM) {
+    drush_set_option('master_url', drush_get_option('master_url'), 'platform');
+    drush_set_option('publish_path', drush_get_option('publish_path'), 'platform');
+    drush_set_option('web_host', drush_get_option('web_host', '127.0.0.1'), 'platform');
+    drush_set_option('web_group', drush_get_option('web_group'), 'platform');
+    drush_set_option('script_user', drush_get_option('script_user'), 'platform');
+    drush_set_option('restart_cmd', drush_get_option('restart_cmd'), 'platform');
+    drush_set_option('backup_path', drush_get_option('backup_path'), 'platform');
+    drush_set_option('config_path', drush_get_option('config_path'), 'platform');
+  }
+}
