This file contains the class moodle_google_curlio.
Copyright: | 2013 Frédéric Massart |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 204 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
moodle_google_curlio:: (6 methods):
do_request()
executeRequest()
setOptions()
setTimeout()
getTimeout()
get_option_name_from_constant()
Class: moodle_google_curlio - X-Ref
Class moodle_google_curlio.do_request($curl, $request) X-Ref |
Send the request via our curl object. return: string result of the request. param: curl $curl prepared curl object. param: Google_HttpRequest $request The request. |
executeRequest(Google_Http_Request $request) X-Ref |
Execute an API request. This is a copy/paste from the parent class that uses Moodle's implementation of curl. Portions have been removed or altered. return: Google_Http_Request http request with the response http code, response param: Google_Http_Request $request the http request to be executed |
setOptions($optparams) X-Ref |
Set curl options. We overwrite this method to ensure that the data passed meets the requirement of our curl implementation and so that the keys are strings, and not curl constants. return: void param: array $optparams Multiple options used by a cURL session. |
setTimeout($timeout) X-Ref |
Set the maximum request time in seconds. Overridden to use the right option key. param: $timeout in seconds |
getTimeout() X-Ref |
Get the maximum request time in seconds. Overridden to use the right option key. return: timeout in seconds. |
get_option_name_from_constant($constant) X-Ref |
Return the name of an option based on the constant value. return: string name of the constant if found, or throws exception. param: int $constant value of a CURL constant. |