Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $api_check = FALSE;
- $headers = getallheaders();
- foreach($headers as $key => $value) {
- if (stripos($key, 'X-API') !== FALSE) {
- $api_check = TRUE;
- }
- }
- // you get the idea ^
- // so contrib modules can get patches to opt-out of expensive hook_init/hook_boot or whatever rendering
- // needs that may be horribly expensive and unnecessary for an API call
- // eg
- // some_awesome_module_init() {
- // if (i_can_has_api()) {
- // return;
- // }
- // // beautiful, world-changing code that sadly does not help w/ teh JSONs...
- // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement