You appear to be a bot. Output may be restricted
Description
Create the APIs for a componentList the files for the component Components supported: "wordpress" – all files in the WordPress installation excluding wp-content <i>plugin</i> – all the files in the named plugin <i>theme</i> – all the files in the named theme Process each file in the component, defining the file, classes, methods and APIs
Usage
_ca_doaplugin_local( $component, $previous, $start );
Parameters
- $component
- ( string ) required – the name of the plugin or theme, or "wordpress"
- $previous
- ( string ) optional – the previous version to compare against – for performance
- $start
- ( string ) optional –
Returns
voidSource
File name: oik-shortcodes/admin/oik-create-apis.phpLines:
1 to 66 of 66
function _ca_doaplugin_local( $component, $previous=null, $start=null ) { global $plugin; $plugin = $component; if ( $plugin ) { $component_type = oiksc_query_component_type( $plugin ); if ( $component_type ) { echo "Doing a $component_type: " . $plugin . PHP_EOL; $response = oikb_get_response( "Continue?", true ); if ( $response ) { oik_require( "admin/oik-apis.php", "oik-shortcodes" ); //wp_register_plugin_realpath( WP_PLUGIN_DIR . "/$plugin/." ); oik_require( "oik-list-wordpress-files.php", "oik-batch" ); oik_require( "oik-list-previous-files.php", "oik-batch" ); $component_preloaded = oiksc_pre_load_component( $plugin, $component_type ); if ( $component_preloaded ) { $oiksc_parse_status = oiksc_parse_status::instance(); $oiksc_parse_status->register_fields(); $oiksc_parse_status->set_component( $component_preloaded->ID ); $oiksc_parse_status->fetch_status(); $finished = $oiksc_parse_status->finished_two_passes(); if ( $finished && null == $previous ) { $previous = $oiksc_parse_status->get_to_sha( $previous ); echo "We've finished the previous pass: $previous" . PHP_EOL; } else { if ( "0" === $previous && $start < 1 ) { oiksc_delete_posts( $component_preloaded ); $oiksc_parse_status->set_component( $component_preloaded->ID ); $oiksc_parse_status->update_status(); oiksc_preload_content(); } else { echo "Previous: $previous" . PHP_EOL; } $previous = $oiksc_parse_status->get_from_sha( $previous ); $start = $oiksc_parse_status->get_file_m( $start ); echo "Continuing previous pass: $previous from $start" . PHP_EOL; } $files = oikb_list_changed_files( $previous, $plugin, $component_type, $oiksc_parse_status ); if ( null === $files ) { $files = oiksc_load_files( $plugin, $component_type ); $files = oikb_maybe_do_files( $files, $previous, $component, $component_type ); } if ( $component_type == "wordpress" ) { $files = oikb_filter_wordpress_files( $files ); } $finished = $oiksc_parse_status->finished_two_passes(); if ( !$finished ) { oiksc_do_files( $files, $plugin, $component_type, "_ca_dofile_local", $start ); } } else { echo "Plugin/theme not defined: $component" . PHP_EOL; } } else { echo "Invalid plugin/theme: $component" . PHP_EOL; } } else { //echo "Missing --plugin= parameter" . PHP_EOL; echo "Cannot determine component type for: $component" . PHP_EOL; echo "Perhaps the component is not available." . PHP_EOL; bw_trace2( $component, "Missing component", true, BW_TRACE_WARNING ); } } }View on GitHub