You appear to be a bot. Output may be restricted
Description
Logic invoked when oik-bwtrace is loadedoik-bwtrace can get loaded as a normal plugin, or from the _oik-bwtrace-mu plugin Since its purpose is to enable tracing of WordPress core, plugins and themes it's coded to be able to start up lazily and not expect the whole of WordPress to be up and running. Some parts of oik-bwtrace are dependent on functions in the oik base plugin. If these functions are not available then it won't do anything. For the run-time part we now make used of shared library logic, supported by the oik-lib plugin If this has been loaded before us then we can use its logic. Otherwise we have to operate in a standalone mode.
Usage
oik_bwtrace_loaded();
Parameters
Returns
voidSource
File name: oik-bwtrace/oik-bwtrace.phpLines:
1 to 72 of 72
function oik_bwtrace_loaded() { /* * Since this plugin is defined to load first... so that it can perform the trace reset * then we need to load oik_boot ourselves... * Amongst other things we need bw_array_get() and oik_require() */ if ( !function_exists( 'oik_require' ) ) { // check that oik v2.6 (or higher) is available. $oik_boot = dirname( __FILE__ ). "/libs/oik_boot.php"; if ( file_exists( $oik_boot ) ) { require_once( $oik_boot ); } } /* * Only carry on if "oik_require2()" exists - which indicates oik is version 1.17 or higher * * It's no longer necessary to check for oik_require2 since this is the code from the already split out oik-bwtrace * If oik really is backlevel then we may have a problem. */ if ( function_exists( "oik_require2" )) { oik_lib_fallback( dirname( __FILE__ ) . '/libs' ); oik_require( "libs/bwtrace.php", "oik-bwtrace" ); oik_require( "libs/bwtrace_boot.php", "oik-bwtrace" ); oik_require( "libs/bwtrace_log.php", "oik-bwtrace" ); oik_require( "includes/bwtrace.php", "oik-bwtrace" ); // Don't use require2 as this file's no longer part of oik } /** * Constants for bw_trace2's $level parameter * * - The trace record is produced if the $level passed is greater than or equal to the current tracing level ( $bw_trace_on ); * - The default value for bw_trace2 is BW_TRACE_ALWAYS * - The higher you set the value the more tracing you get. * - The testing is NOT (yet) implemented as a bit-mask. * - Note: Most of these values are a subset of logging levels in packages such as monolog. * - It's not really necessary to have CRITICAL, ALERT or EMERGENCY; ERROR will suffice * - See also {@link https://en.wikipedia.org/wiki/Syslog#Severity_levels} * */ if ( !defined( 'BW_TRACE_VERBOSE' ) ) { define( 'BW_TRACE_VERBOSE', 64 ); } if ( !defined( 'BW_TRACE_DEBUG' ) ) { define( 'BW_TRACE_DEBUG', 32 ); } if ( !defined( 'BW_TRACE_INFO' ) ) { define( 'BW_TRACE_INFO', 16 ); } // recommended level if ( !defined( 'BW_TRACE_NOTICE' ) ) { define( 'BW_TRACE_NOTICE', 8 ); } if ( !defined( 'BW_TRACE_WARNING' ) ) { define( 'BW_TRACE_WARNING', 4 ); } if ( !defined( 'BW_TRACE_ERROR' ) ) { define( 'BW_TRACE_ERROR', 2 ); } if ( !defined( 'BW_TRACE_ALWAYS' ) ) { define( 'BW_TRACE_ALWAYS', 0 ); } // bw_trace2() default /* * Invoke the start up logic if "add_action" is available * 2018/01/30 - I can't see why we need this test but it probably does no harm. * */ if ( function_exists( "add_action" ) ) { bw_trace_plugin_startup(); } /* * Selected actions, such as shutdown actions are implemented in includes/oik-actions.php * */ oik_require( "includes/bwtrace-actions.php", "oik-bwtrace" ); bw_trace_add_selected_actions(); /* * Add trace command for WP-CLI */ oik_bwtrace_wp_cli(); oik_bwtrace_initialise_trace_summary(); }View on GitHub View on Trac