3c30d940a4c568e07bef1bfb4bef6549fdc9d9c3
[autoinstalls/wordpress.git] / wp-admin / upgrade.php
1 <?php
2 define('WP_INSTALLING', true);
3 if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. Double check that you updated wp-config-sample.php with the proper database connection information and renamed it to wp-config.php.");
4 require('../wp-config.php');
5 timer_start();
6 require_once(ABSPATH . '/wp-admin/upgrade-functions.php');
7
8 $step = $_GET['step'];
9 if (!$step) $step = 0;
10 header( 'Content-Type: text/html; charset=utf-8' );
11 ?>
12 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
13 <html xmlns="http://www.w3.org/1999/xhtml">
14 <head>
15         <title>WordPress &rsaquo; Upgrade</title>
16         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
17         <style media="screen" type="text/css">
18         <!--
19         html {
20                 background: #eee;
21         }
22         body {
23                 background: #fff;
24                 color: #000;
25                 font-family: Georgia, "Times New Roman", Times, serif;
26                 margin-left: 20%;
27                 margin-right: 20%;
28                 padding: .2em 2em;
29         }
30         
31         h1 {
32                 color: #006;
33                 font-size: 18px;
34                 font-weight: lighter;
35         }
36         
37         h2 {
38                 font-size: 16px;
39         }
40         
41         p, li, dt {
42                 line-height: 140%;
43                 padding-bottom: 2px;
44         }
45
46         ul, ol {
47                 padding: 5px 5px 5px 20px;
48         }
49         #logo {
50                 margin-bottom: 2em;
51         }
52 .step a, .step input {
53         font-size: 2em;
54 }
55 .step, th {
56         text-align: right;
57 }
58 #footer {
59 text-align: center; border-top: 1px solid #ccc; padding-top: 1em; font-style: italic;
60 }
61         -->
62         </style>
63 </head>
64 <body>
65 <h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1>
66 <?php
67 switch($step) {
68
69         case 0:
70         $goback = wp_specialchars(wp_get_referer());
71 ?> 
72 <p><?php _e('This file upgrades you from any previous version of WordPress to the latest. It may take a while though, so be patient.'); ?></p> 
73         <h2 class="step"><a href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress &raquo;'); ?></a></h2>
74 <?php
75         break;
76         
77         case 1:
78         $wp_current_db_version = __get_option('db_version');
79         if ( $wp_db_version != $wp_current_db_version ) {
80                 wp_cache_flush();
81                 make_db_current_silent();
82                 upgrade_all();
83                 wp_cache_flush();
84         }
85
86         if ( empty( $_GET['backto'] ) )
87                 $backto = __get_option('home');
88         else
89                 $backto = wp_specialchars( $_GET['backto'] , 1 );
90 ?> 
91 <h2><?php _e('Step 1'); ?></h2> 
92         <p><?php printf(__("There's actually only one step. So if you see this, you're done. <a href='%s'>Have fun</a>!"),  $backto); ?></p>
93
94 <!--
95 <pre>
96 <?php printf(__('%s queries'), $wpdb->num_queries); ?>
97
98 <?php printf(__('%s seconds'), timer_stop(0)); ?>
99 </pre>
100 -->
101
102 <?php
103         break;
104 }
105 ?> 
106 </body>
107 </html>