diff --git a/core/cron.php b/core/cron.php
index fa9aa14..301047a 100644
--- a/core/cron.php
+++ b/core/cron.php
@@ -16,7 +16,7 @@ define('DRUPAL_ROOT', getcwd());
include_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
-if (!isset($_GET['cron_key']) || variable_get('cron_key', 'drupal') != $_GET['cron_key']) {
+if (!isset($_GET['cron_key']) || config('system.cron')->get('cron_key') != $_GET['cron_key']) {
watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
drupal_access_denied();
}
diff --git a/core/modules/aggregator/aggregator.test b/core/modules/aggregator/aggregator.test
index 2149bed..e0dfd90 100644
--- a/core/modules/aggregator/aggregator.test
+++ b/core/modules/aggregator/aggregator.test
@@ -798,7 +798,7 @@ class AggregatorCronTestCase extends AggregatorTestCase {
public function testCron() {
// Create feed and test basic updating on cron.
global $base_url;
- $key = variable_get('cron_key', 'drupal');
+ $key = config('system.cron')->get('cron_key');
$this->createSampleNodes();
$feed = $this->createFeed();
$this->drupalGet($base_url . '/core/cron.php', array('external' => TRUE, 'query' => array('cron_key' => $key)));
diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php
index a2d85cb..1357d36 100644
--- a/core/modules/simpletest/drupal_web_test_case.php
+++ b/core/modules/simpletest/drupal_web_test_case.php
@@ -2184,7 +2184,7 @@ class DrupalWebTestCase extends DrupalTestCase {
* Runs cron in the Drupal installed by Simpletest.
*/
protected function cronRun() {
- $this->drupalGet($GLOBALS['base_url'] . '/core/cron.php', array('external' => TRUE, 'query' => array('cron_key' => variable_get('cron_key', 'drupal'))));
+ $this->drupalGet($GLOBALS['base_url'] . '/core/cron.php', array('external' => TRUE, 'query' => array('cron_key' => config('system.cron')->get('cron_key'))));
}
/**
diff --git a/core/modules/system/config/system.cron.xml b/core/modules/system/config/system.cron.xml
new file mode 100644
index 0000000..3d56be1
--- /dev/null
+++ b/core/modules/system/config/system.cron.xml
@@ -0,0 +1,7 @@
+
+
' . t('Cron takes care of running periodic tasks like checking for updates and indexing content for search.') . '
', ); @@ -1588,10 +1588,13 @@ function system_cron_settings() { $form['cron']['cron_safe_threshold'] = array( '#type' => 'select', '#title' => t('Run cron every'), - '#default_value' => variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD), + '#default_value' => config('system.cron')->get('cron_safe_threshold'), '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 43200, 86400, 604800), 'format_interval'), ); - + $form_state['config']['cron_safe_threshold'] = array( + 'name' => 'system.cron', + 'path' => 'cron_safe_threshold', + ); return system_settings_form($form); } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 905d11d..8c0ac2b 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -254,9 +254,9 @@ function system_requirements($phase) { // Report cron status. if ($phase == 'runtime') { // Cron warning threshold defaults to two days. - $threshold_warning = variable_get('cron_threshold_warning', 172800); + $threshold_warning = config('system.cron')->get('cron_threshold_warning'); // Cron error threshold defaults to two weeks. - $threshold_error = variable_get('cron_threshold_error', 1209600); + $threshold_error = config('system.cron')->get('cron_threshold_error'); // Cron configuration help text. $help = $t('For more information, see the online handbook entry for configuring cron jobs.', array('@cron-handbook' => 'http://drupal.org/cron')); @@ -283,7 +283,7 @@ function system_requirements($phase) { } $description .= ' ' . $t('You can run cron manually.', array('@cron' => url('admin/reports/status/run-cron'))); - $description .= '