Changeset 44674
- Timestamp:
- 01/21/2019 08:14:56 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin.php
r44630 r44674 469 469 function _get_dropins() { 470 470 $dropins = array( 471 'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE472 'db.php' => array( __( 'Custom database class.' ), true ), // auto on load473 'db-error.php' => array( __( 'Custom database error message.' ), true ), // auto on error474 'install.php' => array( __( 'Custom installation script.' ), true ), // auto on installation475 'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance476 'object-cache.php' => array( __( 'External object cache.' ), true ), // auto on load477 'php-error.php' => array( __( 'Custom PHP error message.' ), true ), // auto on error478 ' shutdown-handler.php' => array( __( 'Custom PHP shutdownhandler.' ), true ), // auto on error471 'advanced-cache.php' => array( __( 'Advanced caching plugin.' ), 'WP_CACHE' ), // WP_CACHE 472 'db.php' => array( __( 'Custom database class.' ), true ), // auto on load 473 'db-error.php' => array( __( 'Custom database error message.' ), true ), // auto on error 474 'install.php' => array( __( 'Custom installation script.' ), true ), // auto on installation 475 'maintenance.php' => array( __( 'Custom maintenance message.' ), true ), // auto on maintenance 476 'object-cache.php' => array( __( 'External object cache.' ), true ), // auto on load 477 'php-error.php' => array( __( 'Custom PHP error message.' ), true ), // auto on error 478 'fatal-error-handler.php' => array( __( 'Custom PHP fatal error handler.' ), true ), // auto on error 479 479 ); 480 480 -
trunk/src/wp-includes/class-wp-fatal-error-handler.php
r44673 r44674 1 1 <?php 2 2 /** 3 * Error Protection API: WP_ Shutdown_Handler class3 * Error Protection API: WP_Fatal_Error_Handler class 4 4 * 5 5 * @package WordPress … … 8 8 9 9 /** 10 * Core class used as the default shutdown handler .10 * Core class used as the default shutdown handler for fatal errors. 11 11 * 12 * A drop-in 'shutdown-handler.php' can be used to override the instance of this class and use a custom implementation 13 * for the shutdown handler that WordPress registers. The custom class should extend this class and can override its 14 * methods individually as necessary. The file must return the instance of the class that should be registered. 12 * A drop-in 'fatal-error-handler.php' can be used to override the instance of this class and use a custom 13 * implementation for the fatal error handler that WordPress registers. The custom class should extend this class and 14 * can override its methods individually as necessary. The file must return the instance of the class that should be 15 * registered. 15 16 * 16 17 * @since 5.1.0 17 18 */ 18 class WP_ Shutdown_Handler {19 class WP_Fatal_Error_Handler { 19 20 20 21 /** … … 127 128 * `wp-includes/load.php` should be checked for before being called. 128 129 * 129 * If no such drop-in is available, this will call {@see WP_ Shutdown_Handler::display_default_error_template()}.130 * If no such drop-in is available, this will call {@see WP_Fatal_Error_Handler::display_default_error_template()}. 130 131 * 131 132 * @since 5.1.0 -
trunk/src/wp-includes/error-protection.php
r44524 r44674 149 149 150 150 /** 151 * Registers the WordPress premature shutdown handler. 151 * Registers the shutdown handler for fatal errors. 152 * 153 * The handler will only be registered if {@see wp_is_fatal_error_handler_enabled()} returns true. 152 154 * 153 155 * @since 5.1.0 154 156 */ 155 function wp_register_premature_shutdown_handler() { 157 function wp_register_fatal_error_handler() { 158 if ( ! wp_is_fatal_error_handler_enabled() ) { 159 return; 160 } 161 156 162 $handler = null; 157 if ( defined( 'WP_CONTENT_DIR' ) && is_readable( WP_CONTENT_DIR . '/ shutdown-handler.php' ) ) {158 $handler = include WP_CONTENT_DIR . '/ shutdown-handler.php';163 if ( defined( 'WP_CONTENT_DIR' ) && is_readable( WP_CONTENT_DIR . '/fatal-error-handler.php' ) ) { 164 $handler = include WP_CONTENT_DIR . '/fatal-error-handler.php'; 159 165 } 160 166 161 167 if ( ! is_object( $handler ) || ! is_callable( array( $handler, 'handle' ) ) ) { 162 $handler = new WP_ Shutdown_Handler();168 $handler = new WP_Fatal_Error_Handler(); 163 169 } 164 170 165 171 register_shutdown_function( array( $handler, 'handle' ) ); 166 172 } 173 174 /** 175 * Checks whether the fatal error handler is enabled. 176 * 177 * A constant `WP_DISABLE_FATAL_ERROR_HANDLER` can be set in `wp-config.php` to disable it, or alternatively the 178 * {@see 'wp_fatal_error_handler_enabled'} filter can be used to modify the return value. 179 * 180 * @since 5.1.0 181 * 182 * @return bool True if the fatal error handler is enabled, false otherwise. 183 */ 184 function wp_is_fatal_error_handler_enabled() { 185 $enabled = ! defined( 'WP_DISABLE_FATAL_ERROR_HANDLER' ) || ! WP_DISABLE_FATAL_ERROR_HANDLER; 186 187 /** 188 * Filters whether the fatal error handler is enabled. 189 * 190 * @since 5.1.0 191 * 192 * @param bool $enabled True if the fatal error handler is enabled, false otherwise. 193 */ 194 return apply_filters( 'wp_fatal_error_handler_enabled', $enabled ); 195 } -
trunk/src/wp-settings.php
r44524 r44674 19 19 require( ABSPATH . WPINC . '/load.php' ); 20 20 require( ABSPATH . WPINC . '/class-wp-paused-extensions-storage.php' ); 21 require( ABSPATH . WPINC . '/class-wp- shutdown-handler.php' );21 require( ABSPATH . WPINC . '/class-wp-fatal-error-handler.php' ); 22 22 require( ABSPATH . WPINC . '/error-protection.php' ); 23 23 require( ABSPATH . WPINC . '/default-constants.php' ); 24 24 require_once( ABSPATH . WPINC . '/plugin.php' ); 25 25 26 // Make sure we register the premature shutdown handleras soon as possible.27 wp_register_ premature_shutdown_handler();26 // Make sure we register the shutdown handler for fatal errors as soon as possible. 27 wp_register_fatal_error_handler(); 28 28 29 29 /*
Note: See TracChangeset
for help on using the changeset viewer.