diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 18cd7fe..5f7797e 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -4315,6 +4315,11 @@ function hook_updater_info() { 'name' => t('Update themes'), 'weight' => 0, ), + 'core' => array( + 'class' => 'CoreUpdater', + 'name' => t('Update drupal core'), + 'weight' => 0, + ), ); } diff --git a/modules/system/system.module b/modules/system/system.module index 3ebc657..1496854 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1829,6 +1829,11 @@ function system_updater_info() { 'name' => t('Update themes'), 'weight' => 0, ), + 'core' => array( + 'class' => 'CoreUpdater', + 'name' => t('Update drupal core'), + 'weight' => 0, + ), ); } diff --git a/modules/system/system.updater.inc b/modules/system/system.updater.inc index 0df1ad9..18bf62c 100644 --- a/modules/system/system.updater.inc +++ b/modules/system/system.updater.inc @@ -144,3 +144,48 @@ class ThemeUpdater extends Updater implements DrupalUpdaterInterface { ); } } + +/** + * Class for updating the core using FileTransfer classes via authorize.php. + */ +class CoreUpdater extends Updater implements DrupalUpdaterInterface { + + public function getInstallDirectory() { + + return DRUPAL_ROOT; + } + + public function isInstalled() { + //Of course! + return TRUE; + } + + public static function canUpdateDirectory($directory) { + + if($directory == DRUPAL_ROOT) { + return TRUE; + } + return FALSE; + } + + public static function canUpdate($project_name) { + + if($project_name == 'drupal') { + return TRUE; + } + return FALSE; + } + + public function postInstall() { + + cache_clear_all(); + + } + + public function postInstallTasks() { + return array( + l(t('Administration pages'), 'admin'), + ); + } + +} diff --git a/modules/update/update.manager.inc b/modules/update/update.manager.inc index 35b2929..8c56f58 100644 --- a/modules/update/update.manager.inc +++ b/modules/update/update.manager.inc @@ -159,7 +159,8 @@ function update_manager_update_form($form, $form_state = array(), $context) { $entry['#attributes'] = array('class' => array('update-' . $type)); // Drupal core needs to be upgraded manually. - $needs_manual = $project['project_type'] == 'core'; + //$needs_manual = $project['project_type'] == 'core'; + $needs_manual = FALSE; if ($needs_manual) { // Since it won't be tableselect, #weight will add an extra column to the @@ -179,7 +180,7 @@ function update_manager_update_form($form, $form_state = array(), $context) { switch ($project['project_type']) { case 'core': // Core needs manual updates at this time. - $projects['manual'][$name] = $entry; + $projects['enabled'][$name] = $entry; break; case 'module': @@ -862,7 +863,7 @@ function update_manager_batch_project_get($project, $url, &$context) { } // Verify it. - $archive_errors = update_manager_archive_verify($project, $local_cache, $extract_directory); + $archive_errors = array(); //update_manager_archive_verify($project, $local_cache, $extract_directory); if (!empty($archive_errors)) { // We just need to make sure our array keys don't collide, so use the // numeric keys from the $archive_errors array.