You appear to be a bot. Output may be restricted
Description
Create the apis for a particular file in a pluginObtain a list of the APIs in the source file. For each API send a message to the server to create/update the API. Note: We ignore classes – these are created dynamically
Usage
_ca_doapis( $file, $plugin_p, $component_type, $start );
Parameters
- $file
- ( string ) required – file name to load
- $plugin_p
- ( mixed ) required –
- $component_type
- ( mixed ) required –
- $start
- ( mixed ) optional default: 1 –
Returns
voidSource
File name: oik-batch/createapi2.phpLines:
1 to 43 of 43
function _ca_doapis( $file, $plugin_p, $component_type, $start=1 ) { global $plugin; $plugin = $plugin_p; static $count = 0; echo "Processing valid: $plugin $file $component_type" . PHP_EOL; $apis = _oiksc_get_apis2( $file, true, $component_type ); foreach ( $apis as $api ) { $count++; if ( $count < $start ) { continue; } //echo "$count $file $api" ; //doapi( $file, $api ); if ( $api->methodname ) { // @TODO move this logic to the server $apitype = $api->getApiType(); $apiname = $api->getApiName(); } else { $apitype = null; $apiname = $api->classname . "::"; } $csv = $api->as_csv( $plugin, $file ); $desc = $api->getShortDescription(); echo "$count,$csv,$apitype,$desc"; oik_require( "oik-admin-ajax.inc", "oik-batch" ); if ( oikb_get_site() ) { //if ( !$plugin ) { if ( $plugin == "wordpress" ) { $file = strip_directory_path( ABSPATH, $file ); } echo "Processing api: $plugin,$file,$apiname" . PHP_EOL; $response = _ca_checkforselected_api( $apiname, $count ); if ( $response ) { $response = oikb_get_response( "Continue to create API?" ); } if ( $response ) { $apikey = oikb_get_apikey(); oikb_admin_ajax_post_create_api( oikb_get_site(), $plugin, $file, $apiname, $apitype, $desc, $apikey ); } } } }View on GitHub