Skip to content

Commit

Permalink
wp_check_php_mysql_versions() during setup and install. see #17934.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@18374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Jun 29, 2011
1 parent 6a36b65 commit ad1e1df
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
10 changes: 3 additions & 7 deletions wp-admin/setup-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
/**#@-*/

require_once(ABSPATH . WPINC . '/load.php');
require_once(ABSPATH . WPINC . '/version.php');
wp_check_php_mysql_versions();

require_once(ABSPATH . WPINC . '/compat.php');
require_once(ABSPATH . WPINC . '/functions.php');
require_once(ABSPATH . WPINC . '/class-wp-error.php');
require_once(ABSPATH . WPINC . '/version.php');

if (!file_exists(ABSPATH . 'wp-config-sample.php'))
wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
Expand All @@ -58,12 +60,6 @@
if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php'))
wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");

if ( version_compare( $required_php_version, phpversion(), '>' ) )
wp_die( sprintf( /*WP_I18N_OLD_PHP*/'Your server is running PHP version %1$s but WordPress requires at least %2$s.'/*/WP_I18N_OLD_PHP*/, phpversion(), $required_php_version ) );

if ( !extension_loaded('mysql') && !file_exists(ABSPATH . 'wp-content/db.php') )
wp_die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ );

if (isset($_GET['step']))
$step = $_GET['step'];
else
Expand Down
5 changes: 5 additions & 0 deletions wp-includes/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* These functions are needed to load WordPress.
*
* This file must be parsable by PHP4.
*
* @package WordPress
*/

Expand Down Expand Up @@ -95,6 +97,9 @@ function wp_fix_server_vars() {
*
* Dies if requirements are not met.
*
* This function must be able to work without a complete environment set up. In wp-load.php, for
* example, WP_CONTENT_DIR is defined and version.php is included before this function is called.
*
* @access private
* @since 3.0.0
*/
Expand Down
5 changes: 5 additions & 0 deletions wp-load.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
else
$path = 'wp-admin/';

require_once( ABSPATH . '/wp-includes/load.php' );
require_once( ABSPATH . '/wp-includes/version.php' );
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
wp_check_php_mysql_versions();

// Die with an error message
require_once( ABSPATH . '/wp-includes/class-wp-error.php' );
require_once( ABSPATH . '/wp-includes/functions.php' );
Expand Down
6 changes: 3 additions & 3 deletions wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
// Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
wp_initial_constants( );

// Check for the required PHP version and for the MySQL extension or a database drop-in.
wp_check_php_mysql_versions();

// Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
set_magic_quotes_runtime( 0 );
@ini_set( 'magic_quotes_sybase', 0 );
Expand All @@ -40,9 +43,6 @@
// Standardize $_SERVER variables across setups.
wp_fix_server_vars();

// Check for the required PHP version and for the MySQL extension or a database drop-in.
wp_check_php_mysql_versions();

// Check if we have received a request due to missing favicon.ico
wp_favicon_request();

Expand Down

0 comments on commit ad1e1df

Please sign in to comment.