summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Jones2011-05-02 09:37:27 (GMT)
committerSteven Jones2011-05-02 09:37:27 (GMT)
commiteb6a11b5f79fc89439b251905d81a3317b4c6800 (patch)
tree49209bb2c007a7e7517241bceb7c11ff0b0b207a
parentecdc93bf94629ec19d5e57f14240be01853763ca (diff)
Use a drush engine, rather than a function to get the cron key.dev-wget-d7-cron-1090678
-rw-r--r--platform/drupal/cron_key.inc6
-rw-r--r--platform/drupal/cron_key_7.inc5
-rw-r--r--platform/import.provision.inc2
-rw-r--r--platform/install.provision.inc2
-rw-r--r--platform/provision_drupal.drush.inc24
-rw-r--r--platform/verify.provision.inc2
6 files changed, 18 insertions, 23 deletions
diff --git a/platform/drupal/cron_key.inc b/platform/drupal/cron_key.inc
new file mode 100644
index 0000000..e646ec5
--- /dev/null
+++ b/platform/drupal/cron_key.inc
@@ -0,0 +1,6 @@
+<?php
+
+// Fetch the cron key from the Drupal site and set in a drush context.
+
+// The cron key feature was introduced in Drupal 7, so for lower versions we do
+// nothing. \ No newline at end of file
diff --git a/platform/drupal/cron_key_7.inc b/platform/drupal/cron_key_7.inc
new file mode 100644
index 0000000..5191068
--- /dev/null
+++ b/platform/drupal/cron_key_7.inc
@@ -0,0 +1,5 @@
+<?php
+
+// Fetch the cron key from the Drupal site and set in a drush context.
+
+drush_set_option('cron_key', variable_get('cron_key', 'drupal')); \ No newline at end of file
diff --git a/platform/import.provision.inc b/platform/import.provision.inc
index 2e525eb..1102b90 100644
--- a/platform/import.provision.inc
+++ b/platform/import.provision.inc
@@ -36,7 +36,7 @@ function drush_provision_drupal_post_provision_import() {
provision_backend_invoke(d()->name, 'provision-verify');
- drush_set_option('cron_key', provision_drupal_fetch_cron_key());
+ drush_include_engine('drupal', 'cron_key');
provision_reload_config('site');
}
diff --git a/platform/install.provision.inc b/platform/install.provision.inc
index d11a4f1..f920a97 100644
--- a/platform/install.provision.inc
+++ b/platform/install.provision.inc
@@ -73,6 +73,6 @@ function drush_provision_drupal_post_provision_install() {
_provision_drupal_rebuild_caches();
drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
_provision_client_create_symlink();
- drush_set_option('cron_key', provision_drupal_fetch_cron_key());
+ drush_include_engine('drupal', 'cron_key');
}
diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc
index 4b301bd..071806e 100644
--- a/platform/provision_drupal.drush.inc
+++ b/platform/provision_drupal.drush.inc
@@ -35,10 +35,11 @@ function provision_drupal_drush_help($section) {
function provision_drupal_drush_engine_drupal() {
$engines = array();
- $engines['install'] = array();
- $engines['import'] = array();
- $engines['deploy'] = array();
$engines['clear'] = array();
+ $engines['cron_key'] = array();
+ $engines['deploy'] = array();
+ $engines['import'] = array();
+ $engines['install'] = array();
$engines['packages'] = array();
$engines['verify'] = array();
return $engines;
@@ -741,20 +742,3 @@ function _provision_client_delete_symlink() {
->fail('Failed to delete symlink @path: @reason');
}
}
-
-/**
- * Fetch the cron key for the currently bootstrapped Drupal site.
- *
- * @return
- * The cron key for the site, may be an empty string on older versions of
- * Drupal.
- */
-function provision_drupal_fetch_cron_key() {
- $key = '';
- if (drush_drupal_major_version() >= 7) {
- $key = variable_get('cron_key', 'drupal');
- }
-
- return $key;
-}
-
diff --git a/platform/verify.provision.inc b/platform/verify.provision.inc
index fa22ccb..4864859 100644
--- a/platform/verify.provision.inc
+++ b/platform/verify.provision.inc
@@ -99,7 +99,7 @@ function drush_provision_drupal_post_provision_verify() {
drush_set_option('installed', TRUE, 'site');
_provision_client_create_symlink();
- drush_set_option('cron_key', provision_drupal_fetch_cron_key());
+ drush_include_engine('drupal', 'cron_key');
}
}