1 | <?php |
||
10 | class Config |
||
11 | { |
||
12 | /** @var int How long to wait for a response from the API */ |
||
13 | protected $timeout = 5; |
||
14 | /** @var int how long to wait while connecting to the API */ |
||
15 | protected $connectionTimeout = 5; |
||
16 | /** |
||
17 | * Decode JSON Response as associative Array |
||
18 | * |
||
19 | * @see http://php.net/manual/en/function.json-decode.php |
||
20 | * |
||
21 | * @var bool |
||
22 | */ |
||
23 | protected $decodeJsonAsArray = false; |
||
24 | /** @var string User-Agent header */ |
||
25 | protected $userAgent = 'TwitterOAuth (+https://twitteroauth.com)'; |
||
26 | /** @var array Store proxy connection details */ |
||
27 | protected $proxy = []; |
||
28 | |||
29 | /** @var bool Whether to encode the curl requests with gzip or not */ |
||
30 | protected $gzipEncoding = true; |
||
31 | |||
32 | /** |
||
33 | * Set the connection and response timeouts. |
||
34 | * |
||
35 | * @param int $connectionTimeout |
||
36 | * @param int $timeout |
||
37 | */ |
||
38 | public function setTimeouts($connectionTimeout, $timeout) |
||
43 | |||
44 | /** |
||
45 | * @param bool $value |
||
46 | */ |
||
47 | public function setDecodeJsonAsArray($value) |
||
51 | |||
52 | /** |
||
53 | * @param string $userAgent |
||
54 | */ |
||
55 | public function setUserAgent($userAgent) |
||
59 | |||
60 | /** |
||
61 | * @param array $proxy |
||
62 | */ |
||
63 | public function setProxy(array $proxy) |
||
67 | |||
68 | /** |
||
69 | * Whether to encode the curl requests with gzip or not. |
||
70 | * |
||
71 | * @param boolean $gzipEncoding |
||
72 | */ |
||
73 | public function setGzipEncoding($gzipEncoding) |
||
77 | } |
||
78 |