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