summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Rossouw2008-11-06 19:46:08 +0000
committeradrian2008-11-06 19:46:08 +0000
commit5e2e4720d5a64f580b4cdf159f7d96731a32b0b8 (patch)
treea74364571020dd52ce73682f946b5705da984e9c
parentdd41901b9ca1c2a465b96c5accfb714f489da1d5 (diff)
Add provision cron command6.x-0.1-beta2
-rw-r--r--provision.module23
1 files changed, 23 insertions, 0 deletions
diff --git a/provision.module b/provision.module
index 515073e..89a7d61 100644
--- a/provision.module
+++ b/provision.module
@@ -25,6 +25,7 @@
* enable - Re-enable a site that has already been disabled. Recreates the virtual host file.
* delete - Generates a back up of the site, and then removes all references to it.
* restore - Revert to a previous backup of the site.
+* cron - Run cron process for a site
*
* Not implemented yet :
* upgrade - Accepts a site package (backup) as argument, and redeploys it, running the upgrade processes on it.
@@ -347,6 +348,12 @@ function provision_drush_command() {
'description' => 'Delete a site.'
);
+ $items['provision cron'] = array(
+ 'callback' => '_provision_cron',
+ 'description' => 'Run cron process for site.',
+ 'arguments' => array('domain.com' => t('The domain of the site to be processed'))
+ );
+
if (!function_exists('hosting_setup')) {
$items['provision setup'] = array(
'callback' => '_provision_setup_cmd',
@@ -787,3 +794,19 @@ function _provision_setup_cmd() {
print "\nThe command did not complete successfully, please fix the issues and re-run this script.";
}
}
+
+/**
+ * Drush command to run cron
+ */
+function _provision_cron($url) {
+ if (!_provision_drupal_site_installed($url)) {
+ provision_log("Error", "Site has not been installed yet.");
+ provision_set_error(PROVISION_SITE_NOT_FOUND);
+ provision_output($url, $data);
+ }
+ $data = provision_get_site_data($url);
+ _provision_drupal_switch_active_site($url);
+ drupal_cron_run();
+ _provision_drupal_switch_active_site();
+
+}