source: trunk/www.guidonia.net/wp/wp-admin/upgrade.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 2.7 KB
Line 
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 */
15define( 'WP_INSTALLING', true );
16
17/** Load WordPress Bootstrap */
18require( '../wp-load.php' );
19
20timer_start();
21require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
22
23delete_transient('update_core');
24
25if ( isset( $_GET['step'] ) )
26 $step = $_GET['step'];
27else
28 $step = 0;
29
30// Do it. No output.
31if ( 'upgrade_db' === $step ) {
32 wp_upgrade();
33 die( '0' );
34}
35
36$step = (int) $step;
37
38@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
39?>
40<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
41<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
42<head>
43 <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
44 <title><?php _e( 'WordPress &rsaquo; Upgrade' ); ?></title>
45 <?php wp_admin_css( 'install', true ); ?>
46</head>
47<body>
48<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
49
50<?php if ( get_option( 'db_version' ) == $wp_db_version || !is_blog_installed() ) : ?>
51
52<h2><?php _e( 'No Upgrade Required' ); ?></h2>
53<p><?php _e( 'Your WordPress database is already up-to-date!' ); ?></p>
54<p class="step"><a class="button" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
55
56<?php else :
57switch ( $step ) :
58 case 0:
59 $goback = stripslashes( wp_get_referer() );
60 $goback = esc_url_raw( $goback );
61 $goback = urlencode( $goback );
62?>
63<h2><?php _e( 'Database Upgrade Required' ); ?></h2>
64<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to upgrade your database to the newest version.' ); ?></p>
65<p><?php _e( 'The upgrade process may take a little while, so please be patient.' ); ?></p>
66<p class="step"><a class="button" href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e( 'Upgrade WordPress Database' ); ?></a></p>
67<?php
68 break;
69 case 1:
70 wp_upgrade();
71
72 $backto = empty($_GET['backto']) ? '' : $_GET['backto'] ;
73 $backto = stripslashes( urldecode( $backto ) );
74 $backto = esc_url_raw( $backto );
75 $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');
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;
91endswitch;
92endif;
93?>
94</body>
95</html>
Note: See TracBrowser for help on using the repository browser.