Commit 3f1a0af4 by Scott

Add qa_is_http_get

parent cb812352
...@@ -1112,14 +1112,25 @@ ...@@ -1112,14 +1112,25 @@
} }
/**
* Whether we are responding to an HTTP GET request
* @return bool True if the request is GET
*/
function qa_is_http_get()
{
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
return $_SERVER['REQUEST_METHOD'] === 'GET';
}
/**
* Return true if we are responding to an HTTP POST request
*/
function qa_is_http_post() function qa_is_http_post()
/*
Return true if we are responding to an HTTP POST request
*/
{ {
if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); } if (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }
return ($_SERVER['REQUEST_METHOD']=='POST') || !empty($_POST); return $_SERVER['REQUEST_METHOD'] === 'POST' || !empty($_POST);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment