**Changes**
- **New** `ApiHandler::setTimeout(int $timeout)` method allows to change default timeout before any API request. Timeout is expressed in milliseconds. Overwrites the value passed in constructor, useful when performing multiple queries with same handler but different timeout.
This commit is contained in:
kristuff 2021-12-08 20:42:33 +01:00
commit dc30007818
7 changed files with 25 additions and 9 deletions

View file

@ -13,7 +13,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @version 0.9.14
* @version 0.9.15
* @copyright 2020-2021 Kristuff
*/
@ -34,7 +34,7 @@ class ApiHandler extends ApiBase
/**
* @var string
*/
const VERSION = 'v0.9.14';
const VERSION = 'v0.9.15';
/**
* The ips to remove from report messages
@ -72,6 +72,21 @@ class ApiHandler extends ApiBase
$this->timeout = $timeout;
}
/**
* Sets the cURL timeout (apply then to any API request). Overwrites the value passed in
* constructor, useful when performing multiple queries with same handler but different timeout.
*
* @access public
* @param int $timeout The maximum number of milliseconds to allow internal cURL functions
* to execute.
*
* @return void
*/
public function setTimeout(int $timeout): void
{
$this->timeout = $timeout;
}
/**
* Get the current configuration in a indexed array
*