[ PHPXref.com ] [ Generated: Thu Aug 19 03:45:23 2010 ] [ WordPress 3.0.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/wp-admin/ -> upgrade.php (source)

   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  delete_site_transient('update_core');
  24  
  25  if ( isset( $_GET['step'] ) )
  26      $step = $_GET['step'];
  27  else
  28      $step = 0;
  29  
  30  // Do it.  No output.
  31  if ( 'upgrade_db' === $step ) {
  32      wp_upgrade();
  33      die( '0' );
  34  }
  35  
  36  $step = (int) $step;
  37  
  38  $php_version    = phpversion();
  39  $mysql_version  = $wpdb->db_version();
  40  $php_compat     = version_compare( $php_version, $required_php_version, '>=' );
  41  $mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
  42  
  43  @header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
  44  ?>
  45  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  46  <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
  47  <head>
  48      <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
  49      <title><?php _e( 'WordPress &rsaquo; Upgrade' ); ?></title>
  50      <?php
  51      wp_admin_css( 'install', true );
  52      wp_admin_css( 'ie', true );
  53      ?>
  54  </head>
  55  <body>
  56  <h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
  57  
  58  <?php if ( get_option( 'db_version' ) == $wp_db_version || !is_blog_installed() ) : ?>
  59  
  60  <h2><?php _e( 'No Upgrade Required' ); ?></h2>
  61  <p><?php _e( 'Your WordPress database is already up-to-date!' ); ?></p>
  62  <p class="step"><a class="button" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
  63  
  64  <?php elseif ( !$php_compat || !$mysql_compat ) :
  65      if ( !$mysql_compat && !$php_compat )
  66          printf( __('You cannot upgrade because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
  67      elseif ( !$php_compat )
  68          printf( __('You cannot upgrade because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
  69      elseif ( !$mysql_compat )
  70          printf( __('You cannot upgrade because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
  71  ?>
  72  <?php else :
  73  switch ( $step ) :
  74      case 0:
  75          $goback = stripslashes( wp_get_referer() );
  76          $goback = esc_url_raw( $goback );
  77          $goback = urlencode( $goback );
  78  ?>
  79  <h2><?php _e( 'Database Upgrade Required' ); ?></h2>
  80  <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>
  81  <p><?php _e( 'The upgrade process may take a little while, so please be patient.' ); ?></p>
  82  <p class="step"><a class="button" href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e( 'Upgrade WordPress Database' ); ?></a></p>
  83  <?php
  84          break;
  85      case 1:
  86          wp_upgrade();
  87  
  88              $backto = !empty($_GET['backto']) ? stripslashes( urldecode( $_GET['backto'] ) ) :  __get_option( 'home' ) . '/';
  89              $backto = esc_url_raw( $backto );
  90              $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');
  91  ?>
  92  <h2><?php _e( 'Upgrade Complete' ); ?></h2>
  93      <p><?php _e( 'Your WordPress database has been successfully upgraded!' ); ?></p>
  94      <p class="step"><a class="button" href="<?php echo $backto; ?>"><?php _e( 'Continue' ); ?></a></p>
  95  
  96  <!--
  97  <pre>
  98  <?php printf( __( '%s queries' ), $wpdb->num_queries ); ?>
  99  
 100  <?php printf( __( '%s seconds' ), timer_stop( 0 ) ); ?>
 101  </pre>
 102  -->
 103  
 104  <?php
 105          break;
 106  endswitch;
 107  endif;
 108  ?>
 109  </body>
 110  </html>


[ Powered by PHPXref - Served by Debian GNU/Linux ]