Wordpress 2.7.1-scripts
[autoinstalls/wordpress.git] / wp-admin / upgrade.php
1 <?php
2 /**
3  * Upgrade WordPress Page.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /**
10  * We are upgrading WordPress.
11  *
12  * @since unknown
13  * @var bool
14  */
15 define('WP_INSTALLING', true);
16
17 /** Load WordPress Bootstrap */
18 require('../wp-load.php');
19
20 timer_start();
21 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
22
23 if ( isset($_GET['step']) )
24         $step = $_GET['step'];
25 else
26         $step = 0;
27
28 // Do it.  No output.
29 if ( 'upgrade_db' === $step ) {
30         wp_upgrade();
31         die('0');
32 }
33
34 $step = (int) $step;
35
36 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
37 ?>
38 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
39 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
40 <head>
41         <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
42         <title><?php _e('WordPress &rsaquo; Upgrade'); ?></title>
43         <?php wp_admin_css( 'install', true ); ?>
44 </head>
45 <body>
46 <h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
47
48 <?php if ( get_option('db_version') == $wp_db_version || !is_blog_installed()) : ?>
49
50 <h2><?php _e('No Upgrade Required'); ?></h2>
51 <p><?php _e('Your WordPress database is already up-to-date!'); ?></p>
52 <p class="step"><a class="button" href="<?php echo get_option('home'); ?>/"><?php _e('Continue'); ?></a></p>
53
54 <?php else :
55 switch($step) :
56         case 0:
57                 $goback = stripslashes(wp_get_referer());
58                 $goback = clean_url($goback, null, 'url');
59                 $goback = urlencode($goback);
60 ?>
61 <h2><?php _e('Database Upgrade Required'); ?></h2>
62 <p><?php _e('Your WordPress database is out-of-date, and must be upgraded before you can continue.'); ?></p>
63 <p><?php _e('The upgrade process may take a while, so please be patient.'); ?></p>
64 <p class="step"><a class="button" href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress'); ?></a></p>
65 <?php
66                 break;
67         case 1:
68                 wp_upgrade();
69
70                 if ( empty( $_GET['backto'] ) )
71                         $backto = __get_option('home') . '/';
72                 else {
73                         $backto = stripslashes(urldecode($_GET['backto']));
74                         $backto = clean_url($backto, null, 'url');
75                 }
76 ?>
77 <h2><?php _e('Upgrade Complete'); ?></h2>
78         <p><?php _e('Your WordPress database has been successfully upgraded!'); ?></p>
79         <p class="step"><a class="button" href="<?php echo $backto; ?>"><?php _e('Continue'); ?></a></p>
80
81 <!--
82 <pre>
83 <?php printf(__('%s queries'), $wpdb->num_queries); ?>
84
85 <?php printf(__('%s seconds'), timer_stop(0)); ?>
86 </pre>
87 -->
88
89 <?php
90                 break;
91 endswitch;
92 endif;
93 ?>
94 </body>
95 </html>