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
_lf_dofile_ajax( $file );Parameters
- $file
- ( string ) required – file name to load
Returns
voidSource
File name: oik-batch/createapi2.phpLines:
1 to 19 of 19
function _lf_dofile_ajax( $file ) { global $plugin; if ( oikb_get_site() ) { if ( $plugin == "wordpress" ) { $file = strip_directory_path( ABSPATH, $file ); } else { echo $file . PHP_EOL; } echo "Processing file: $plugin,$file" . PHP_EOL; $response = oikb_get_response( "Continue to process file?" ); if ( $response ) { $apikey = oikb_get_apikey(); oik_require( "oik-admin-ajax.inc", "oik-batch" ); oikb_admin_ajax_post_create_file( oikb_get_site(), $plugin, $file, $apikey ); } echo "Processing file: $plugin,$file ended" . PHP_EOL; } }View on GitHub
Invoked by
Calls
1 to 5 of 5
- oikb_admin_ajax_post_create_file() – Invoke admin-ajax using POST to process a file
- oikb_get_apikey() – Obtain the apikey for oik-batch
- oikb_get_response() – Prompt for a response from stdin
- oikb_get_site() – Return the URL of the remote site to access
- strip_directory_path() – Remove the leading directory path from the filename
