Commit eb6a11b5 authored by Steven Jones's avatar Steven Jones

Use a drush engine, rather than a function to get the cron key.

parent ecdc93bf
<?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
<?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
......@@ -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');
}
......
......@@ -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');
}
......@@ -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;
}
......@@ -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');
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment