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