You appear to be a bot. Output may be restricted
Description
Bootstrap logic for oik-wpThe checks if we're running as "CLI" -Command Line Interface
- If we are then we prepare the batch environment
- then, if this file is the first file we run the routine specified on the command line
- or, if it's being run under PHPUnit then we load the unit test environment for the tests that will follow
Usage
oik_wp_loaded();
Parameters
Returns
voidSource
File name: oik-batch/oik-wp.phpLines:
1 to 56 of 56
function oik_wp_loaded() { if ( PHP_SAPI == "cli" ) { if ( defined( 'WP_CLI' ) && WP_CLI ) { // This is WP-CLI, so we don't do anything. } else { oik_batch_load_lib( "oik-cli" ); oik_batch_merge_argv(); oik_batch_start_wordpress(); /* * The plugin may decide to run itself automagically * This code is probably all rubbish now! */ //echo "I got here" . PHP_EOL; //echo "oik-wp running WordPress echo getcwd() . PHP_EOL; oik_batch_debug(); //oik_batch_trace( true ); //oik_batch_define_constants(); // @TODO Not necessary in oik-wp since WordPress has done all of this! oik_batch_load_oik_boot(); //oik_batch_simulate_wp_settings(); //oik_batch_load_wordpress_files(); //oik_batch_load_cli_functions(); echo PHP_SAPI; echo PHP_EOL; $included_files = get_included_files(); if ( $included_files[0] == __FILE__) { oik_batch_run(); } else { if ( false !== strpos( $_SERVER['argv'][0], "phpunit" ) ) { // This is PHPUnit oik_batch_load_wordpress_develop_tests(); } } // wp-batch has been loaded by another PHP routine so that routine is in charge. e.g. boot-fs.php for WP-CLI //echo "who's in charge?" . PHP_EOL; } } else { //echo PHP_SAPI; //echo PHP_EOL; if ( function_exists( "bw_trace2" ) ) { bw_trace2( PHP_SAPI, "oik-wp loaded in WordPress environment?" ); } if ( function_exists( "add_action" ) ) { // if ( bw_is_wordpress() ) { oik_batch_load_lib( "oik-cli" ); oik_batch_load_oik_boot(); add_action( "admin_notices", "oik_batch_activation" ); add_action( "oik_admin_menu", "oik_batch_admin_menu" ); //add_action( "@TODO load shared libraries? } } }View on GitHub