comparison update.php @ 15:4347c45bb494 6.7

Drupal 6.7
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:44 +0100
parents c1f4ac30525a
children
comparison
equal deleted inserted replaced
14:626fcabfa4b8 15:4347c45bb494
1 <?php 1 <?php
2 // $Id: update.php,v 1.252 2008/02/03 18:41:16 goba Exp $ 2 // $Id: update.php,v 1.252.2.2 2008/12/10 22:30:13 goba Exp $
3 3
4 /** 4 /**
5 * @file 5 * @file
6 * Administrative page for handling updates from one Drupal version to another. 6 * Administrative page for handling updates from one Drupal version to another.
7 * 7 *
367 cache_clear_all('*', 'cache_update', TRUE); 367 cache_clear_all('*', 'cache_update', TRUE);
368 } 368 }
369 369
370 update_task_list('info'); 370 update_task_list('info');
371 drupal_set_title('Drupal database update'); 371 drupal_set_title('Drupal database update');
372 $token = drupal_get_token('update');
372 $output = '<p>Use this utility to update your database whenever a new release of Drupal or a module is installed.</p><p>For more detailed information, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>'; 373 $output = '<p>Use this utility to update your database whenever a new release of Drupal or a module is installed.</p><p>For more detailed information, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>';
373 $output .= "<ol>\n"; 374 $output .= "<ol>\n";
374 $output .= "<li><strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.</li>\n"; 375 $output .= "<li><strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.</li>\n";
375 $output .= "<li><strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.</li>\n"; 376 $output .= "<li><strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.</li>\n";
376 $output .= '<li>Put your site into <a href="'. base_path() .'?q=admin/settings/site-maintenance">maintenance mode</a>.</li>'."\n"; 377 $output .= '<li>Put your site into <a href="'. base_path() .'?q=admin/settings/site-maintenance">maintenance mode</a>.</li>'."\n";
377 $output .= "<li>Install your new files in the appropriate location, as described in the handbook.</li>\n"; 378 $output .= "<li>Install your new files in the appropriate location, as described in the handbook.</li>\n";
378 $output .= "</ol>\n"; 379 $output .= "</ol>\n";
379 $output .= "<p>When you have performed the steps above, you may proceed.</p>\n"; 380 $output .= "<p>When you have performed the steps above, you may proceed.</p>\n";
380 $output .= '<form method="post" action="update.php?op=selection"><input type="submit" value="Continue" /></form>'; 381 $output .= '<form method="post" action="update.php?op=selection&token='. $token .'"><input type="submit" value="Continue" /></form>';
381 $output .= "\n"; 382 $output .= "\n";
382 return $output; 383 return $output;
383 } 384 }
384 385
385 function update_access_denied_page() { 386 function update_access_denied_page() {
446 function update_check_incompatibility($name, $type = 'module') { 447 function update_check_incompatibility($name, $type = 'module') {
447 static $themes, $modules; 448 static $themes, $modules;
448 449
449 // Store values of expensive functions for future use. 450 // Store values of expensive functions for future use.
450 if (empty($themes) || empty($modules)) { 451 if (empty($themes) || empty($modules)) {
451 $themes = system_theme_data(); 452 $themes = _system_theme_data();
452 $modules = module_rebuild_cache(); 453 $modules = module_rebuild_cache();
453 } 454 }
454 455
455 if ($type == 'module' && isset($modules[$name])) { 456 if ($type == 'module' && isset($modules[$name])) {
456 $file = $modules[$name]; 457 $file = $modules[$name];
625 update_fix_d6_requirements(); 626 update_fix_d6_requirements();
626 update_fix_compatibility(); 627 update_fix_compatibility();
627 628
628 $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : ''; 629 $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
629 switch ($op) { 630 switch ($op) {
631 case 'selection':
632 if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
633 $output = update_selection_page();
634 break;
635 }
636
637 case 'Update':
638 if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) {
639 update_batch();
640 break;
641 }
642
630 // update.php ops 643 // update.php ops
631 case 'info': 644 case 'info':
632 $output = update_info_page(); 645 $output = update_info_page();
633 break;
634
635 case 'selection':
636 $output = update_selection_page();
637 break;
638
639 case 'Update':
640 update_batch();
641 break; 646 break;
642 647
643 case 'results': 648 case 'results':
644 $output = update_results_page(); 649 $output = update_results_page();
645 break; 650 break;