PluginProbe
QuadMenu – Mega Menu / 3.3.8
QuadMenu – Mega Menu v3.3.8
3.3.8 3.3.7 3.3.6 trunk 1.8.4 1.8.5 1.8.7 1.8.8 1.8.9 1.9.0 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 88 releases
quadmenu / jetpack_vendor / automattic / jetpack-status / src / class-errors.php

class-errors.php in QuadMenu – Mega Menu 3.3.8, at jetpack_vendor/automattic/jetpack-status/src/class-errors.php

52 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * An errors utility class for Jetpack.
4 *
5 * @package automattic/jetpack-status
6 */
7
8 // phpcs:disable WordPress.PHP.IniSet.display_errors_Disallowed
9 // phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
10 // phpcs:disable WordPress.PHP.DevelopmentFunctions.prevent_path_disclosure_error_reporting
11 // phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.runtime_configuration_error_reporting
12
13 namespace Automattic\Jetpack;
14
15 /**
16 * Erros class.
17 *
18 * @deprecated since 3.2.0
19 */
20 class Errors {
21 /**
22 * Catches PHP errors. Must be used in conjunction with output buffering.
23 *
24 * @deprecated since 3.2.0
25 * @param bool $catch True to start catching, False to stop.
26 *
27 * @static
28 */
29 public function catch_errors( $catch ) {
30 _deprecated_function( __METHOD__, '3.2.0' );
31 static $display_errors, $error_reporting;
32
33 if ( $catch ) {
34 // Force error reporting and output, store original values.
35 $display_errors = @ini_set( 'display_errors', 1 );
36 $error_reporting = @error_reporting( E_ALL );
37 if ( class_exists( 'Jetpack' ) ) {
38 add_action( 'shutdown', array( 'Jetpack', 'catch_errors_on_shutdown' ), 0 );
39 }
40 } else {
41 // Restore the original values for error reporting and output.
42 @ini_set( 'display_errors', $display_errors );
43 if ( $error_reporting !== null ) {
44 @error_reporting( $error_reporting );
45 }
46 if ( class_exists( 'Jetpack' ) ) {
47 remove_action( 'shutdown', array( 'Jetpack', 'catch_errors_on_shutdown' ), 0 );
48 }
49 }
50 }
51 }
52