wp/wp-load.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
    19 /** Define ABSPATH as this file's directory */
    19 /** Define ABSPATH as this file's directory */
    20 if ( ! defined( 'ABSPATH' ) ) {
    20 if ( ! defined( 'ABSPATH' ) ) {
    21 	define( 'ABSPATH', __DIR__ . '/' );
    21 	define( 'ABSPATH', __DIR__ . '/' );
    22 }
    22 }
    23 
    23 
    24 error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
    24 /*
       
    25  * The error_reporting() function can be disabled in php.ini. On systems where that is the case,
       
    26  * it's best to add a dummy function to the wp-config.php file, but as this call to the function
       
    27  * is run prior to wp-config.php loading, it is wrapped in a function_exists() check.
       
    28  */
       
    29 if ( function_exists( 'error_reporting' ) ) {
       
    30 	/*
       
    31 	 * Initialize error reporting to a known set of levels.
       
    32 	 *
       
    33 	 * This will be adapted in wp_debug_mode() located in wp-includes/load.php based on WP_DEBUG.
       
    34 	 * @see http://php.net/manual/en/errorfunc.constants.php List of known error levels.
       
    35 	 */
       
    36 	error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
       
    37 }
    25 
    38 
    26 /*
    39 /*
    27  * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
    40  * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
    28  * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
    41  * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
    29  * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
    42  * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
    69 	require_once ABSPATH . WPINC . '/version.php';
    82 	require_once ABSPATH . WPINC . '/version.php';
    70 
    83 
    71 	wp_check_php_mysql_versions();
    84 	wp_check_php_mysql_versions();
    72 	wp_load_translations_early();
    85 	wp_load_translations_early();
    73 
    86 
    74 	// Die with an error message
    87 	// Die with an error message.
    75 	$die = sprintf(
    88 	$die = '<p>' . sprintf(
    76 		/* translators: %s: wp-config.php */
    89 		/* translators: %s: wp-config.php */
    77 		__( "There doesn't seem to be a %s file. I need this before we can get started." ),
    90 		__( "There doesn't seem to be a %s file. I need this before we can get started." ),
    78 		'<code>wp-config.php</code>'
    91 		'<code>wp-config.php</code>'
    79 	) . '</p>';
    92 	) . '</p>';
    80 	$die .= '<p>' . sprintf(
    93 	$die .= '<p>' . sprintf(
    85 	$die .= '<p>' . sprintf(
    98 	$die .= '<p>' . sprintf(
    86 		/* translators: %s: wp-config.php */
    99 		/* translators: %s: wp-config.php */
    87 		__( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ),
   100 		__( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ),
    88 		'<code>wp-config.php</code>'
   101 		'<code>wp-config.php</code>'
    89 	) . '</p>';
   102 	) . '</p>';
    90 	$die .= '<p><a href="' . $path . '" class="button button-large">' . __( 'Create a Configuration File' ) . '</a>';
   103 	$die .= '<p><a href="' . $path . '" class="button button-large">' . __( 'Create a Configuration File' ) . '</a></p>';
    91 
   104 
    92 	wp_die( $die, __( 'WordPress &rsaquo; Error' ) );
   105 	wp_die( $die, __( 'WordPress &rsaquo; Error' ) );
    93 }
   106 }