Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/PhpEws/Ntlm/NtlmSoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*/
class NtlmSoapClient extends \SoapClient
{
private static $timeout = 30;

/**
* cURL resource used to make the SOAP request
*
Expand Down Expand Up @@ -63,6 +65,7 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0
curl_setopt($this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);
curl_setopt($this->ch, CURLOPT_USERPWD, $this->user.':'.$this->password);
curl_setopt($this->ch, CURLOPT_TIMEOUT, self::$timeout);

$response = curl_exec($this->ch);

Expand Down Expand Up @@ -104,4 +107,16 @@ public function validateCertificate($validate = true)

return true;
}

/**
* Set the CURL timeout
*
* @param int $timeout
*/
public static function setTimeout($timeout)
{
self::$timeout = $timeout;
}


}