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