WordPress.org

Make WordPress Core

Changeset 12578


Ignore:
Timestamp:
12/29/09 22:08:33 (4 years ago)
Author:
ryan
Message:

Check PHP and MySQL versions in install.php. see #11666 for 2.9

Location:
branches/2.9/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.9/wp-admin/install.php

    r11930 r12578  
    8383if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');} 
    8484 
     85$php_version    = phpversion(); 
     86$mysql_version  = $wpdb->db_version(); 
     87$php_compat     = version_compare( $php_version, $required_php_version, '>=' ); 
     88$mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); 
     89 
     90if ( !$mysql_compat && !$php_compat ) 
     91    $compat = sprintf( __('You cannot install because WordPress %1$s 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 ); 
     92elseif ( !$php_compat ) 
     93    $compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); 
     94elseif ( !$mysql_compat ) 
     95    $compat = sprintf( __('You cannot install because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); 
     96 
     97if ( !$mysql_compat || !$php_compat ) { 
     98    display_header(); 
     99    die('<h1>' . __('Insufficient Requirements') . '</h1><p>' . $compat . '</p></body></html>'); 
     100} 
     101 
    85102switch($step) { 
    86103    case 0: 
  • branches/2.9/wp-admin/upgrade.php

    r12576 r12578  
    6565        printf( __('You cannot upgrade because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); 
    6666    elseif ( !$mysql_compat ) 
    67         printf( __('You cannot upgrade because because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); 
     67        printf( __('You cannot upgrade because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); 
    6868?> 
    6969<?php else : 
Note: See TracChangeset for help on using the changeset viewer.