| 222 | $php_version = phpversion(); |
| 223 | $php_compat = version_compare( $php_version, '4.3', '>=' ); |
| 224 | $mysql_version = $wpdb->db_version; |
| 225 | $mysql_compat = version_compare( $mysql_version, '4.1.2', '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); |
| 226 | |
| 227 | if ( !$mysql_compat || !$php_compat ) { |
| 228 | $errors = new WP_Error(); |
| 229 | if ( !$php_compat ) |
| 230 | $errors->add( 'php_not_compatible', sprintf( __('The update cannot be installed because WordPress requires PHP version 4.3 or higher. You are running version %s.'), $php_version ) ); |
| 231 | if ( !$mysql_compat ) |
| 232 | $errors->add( 'mysql_not_compatible', sprintf( __('The update cannot be installed because WordPress requires MySQL version 4.1.2 or higher. You are running version %s.'), $mysql_version ) ); |
| 233 | return $errors; |
| 234 | } |
| 235 | |