Skip to content
Snippets Groups Projects
Commit 9b456acc authored by Carsten Karbach's avatar Carsten Karbach
Browse files

Add option to set timeout while sending events

parent e06adfad
Branches
Tags v1.6
No related merge requests found
......@@ -195,10 +195,11 @@ class EventManagement{
* @param string $certFile path to certificate file to use or null to call URL without certificate
* @param string $certKey path to certificate key file, null to avoid usage of key
* @param string $certPassphrase path to passphrase file for key file, null for no passphrase
* @param int $timeout time out in seconds until curl call is aborted
*
* @return boolean true on success, false on error
*/
public function sendEventObject($eventObject, $baseURL='http://localhost/myapps/EventsAPI/rest/events', $certFile = null, $certKey = null, $certPassphrase = null){
public function sendEventObject($eventObject, $baseURL='http://localhost/myapps/EventsAPI/rest/events', $certFile = null, $certKey = null, $certPassphrase = null, $timeout = null){
date_default_timezone_set ( 'Europe/Amsterdam' );
$apiClient = new \jards\eventsapiclient\Swagger\Client\ApiClient ();
$apiClient->getConfig ()->setHost ( $baseURL );
......@@ -212,6 +213,9 @@ class EventManagement{
if(! empty($certPassphrase)){
$apiClient->getConfig ()->setCertificatePassphrase($certPassphrase);
}
if(! empty($timeout)){
$apiClient->getConfig()->setCurlConnectTimeout($timeout);
}
$eventsApi = new EventsApi($apiClient);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment