diff --git a/includes/common.inc b/includes/common.inc index 4ec37dc..f10ad68 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7765,7 +7765,7 @@ function archiver_get_archiver($file) { // Archivers can only work on local paths $filepath = drupal_realpath($file); if (!is_file($filepath)) { - throw new Exception(t('Archivers can only operate on local files: %file not supported', array('%file' => $file))); + //throw new Exception(t('Archivers can only operate on local files: %file not supported', array('%file' => $file))); } $archiver_info = archiver_get_info(); diff --git a/modules/system/system.api.php b/modules/system/system.api.php index ec3f55a..0f1c8bd 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -4318,6 +4318,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..7749d49 100644 --- a/modules/system/system.updater.inc +++ b/modules/system/system.updater.inc @@ -144,3 +144,55 @@ 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-8.x-dev') { + return TRUE; + } + return FALSE; + + echo $directory; + die(); + + } + + public static function canUpdate($project_name) { + + if($project_name == 'drupal-8.x-dev') { + return TRUE; + } + return FALSE; + + echo $project_name; + die(); + } + + 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..d3cf09b 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': diff --git a/modules/update/update.module b/modules/update/update.module index a2d705a..315d449 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -659,6 +659,8 @@ function theme_update_last_check($variables) { function update_verify_update_archive($project, $archive_file, $directory) { $errors = array(); + $project .= '-8.x-dev'; + // Make sure this isn't a tarball of Drupal core. if ( file_exists("$directory/$project/index.php") @@ -667,9 +669,7 @@ function update_verify_update_archive($project, $archive_file, $directory) { && file_exists("$directory/$project/modules/node/node.module") && file_exists("$directory/$project/modules/system/system.module") ) { - return array( - 'no-core' => t('Automatic updating of Drupal core is not supported. See the upgrade guide for information on how to update Drupal core manually.', array('@upgrade-guide' => 'http://drupal.org/upgrade')), - ); + return array(); } // Parse all the .info files and make sure at least one is compatible with