commit b945e9994a48d8edc7e350f5f7d3519ce16f8902 Author: Dean Reilly Date: Sat Sep 29 18:02:45 2012 +0100 Included install_time variable and added update hook. diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 3046b87..bcdb1b9 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1994,5 +1994,5 @@ function install_configure_form_submit($form, &$form_state) { user_login_finalize(); // Record when this install ran. - variable_set('install_time', $_SERVER['REQUEST_TIME']); + state()->set('install_time', $_SERVER['REQUEST_TIME']); } diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 0e3d3d6..be03ab6 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -274,7 +274,7 @@ function system_requirements($phase) { // Determine when cron last ran. $cron_last = variable_get('cron_last'); if (!is_numeric($cron_last)) { - $cron_last = variable_get('install_time', 0); + $cron_last = state()->get('install_time') ?: 0; } // Determine severity based on time since cron last ran. @@ -1976,13 +1976,17 @@ function system_update_8021() { } /** - * Convert install_task variable to state api value. + * Convert install_task and install_time variables to state api values. */ function system_update_8022() { - if ($install_task = update_variable_get('install_task', FALSE)) { - state()->set('install_task', $install_task); + $variables = array('install_task', 'install_time'); + + foreach ($variables as $variable) { + if ($value = update_variable_get($variable, FALSE)) { + state()->set($variable, $value); + } + update_variable_del($variable); } - update_variable_del('install_task'); } /**