You appear to be a bot. Output may be restricted
Description
Determine if this API needs processingIf the parsed source is the latest then no, it doesn't If the parsed source is not the latest then, we have to check if the API has changed since it was last parsed.
Usage
$book = _ca_does_api_need_processing( $api, $file, $component_type, $plugin );
Parameters
- $api
- ( object ) required – object
- $file
- ( string ) required –
- $component_type
- ( string ) required –
- $plugin
- ( string ) required –
Returns
book true if it needs processing, false otherwiseSource
File name: oik-shortcodes/admin/oik-create-apis.phpLines:
1 to 25 of 25
function _ca_does_api_need_processing( $api, $file, $component_type, $plugin ) { $needs_processing = true; $apiname = $api->getApiName(); $post_ids = oikai_get_oik_api_byname( $apiname ); if ( $post_ids ) { $post_id = $post_ids[0]; oik_require( "classes/class-oiksc-parsed-source.php", "oik-shortcodes" ); $oiksc_parsed_source = oiksc_parsed_source::instance(); $parsed_source = $oiksc_parsed_source->get_latest_parsed_source_by_sourceref( $file, $component_type, $post_id, $plugin ); if ( $parsed_source ) { $needs_processing = false; } else { $fileName = oiksc_real_file( $file, $component_type, $plugin ); // Here we need refFunc $refFunc = $api->load_and_reflect(); //print_r( $refFunc ); $sources = oikai_load_from_file( $fileName, $refFunc ); //print_r( $sources ); $needs_processing = $oiksc_parsed_source->is_parsing_necessary( $sources ); } } bw_trace2( $needs_processing, "Needs processing?", true, BW_TRACE_VERBOSE ); return( $needs_processing ); }View on GitHub