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 | /** @var integer Size for Chunked Uploads */ |
||
33 | protected $chunkSize = 250000; // 0.25 MegaByte |
||
34 | |||
35 | /** |
||
36 | * Set the connection and response timeouts. |
||
37 | * |
||
38 | * @param int $connectionTimeout |
||
39 | * @param int $timeout |
||
40 | */ |
||
41 | public function setTimeouts($connectionTimeout, $timeout) |
||
46 | |||
47 | /** |
||
48 | * @param bool $value |
||
49 | */ |
||
50 | public function setDecodeJsonAsArray($value) |
||
54 | |||
55 | /** |
||
56 | * @param string $userAgent |
||
57 | */ |
||
58 | public function setUserAgent($userAgent) |
||
62 | |||
63 | /** |
||
64 | * @param array $proxy |
||
65 | */ |
||
66 | public function setProxy(array $proxy) |
||
70 | |||
71 | /** |
||
72 | * Whether to encode the curl requests with gzip or not. |
||
73 | * |
||
74 | * @param boolean $gzipEncoding |
||
75 | */ |
||
76 | public function setGzipEncoding($gzipEncoding) |
||
80 | |||
81 | /** |
||
82 | * Set the size of each part of file for chunked media upload. |
||
83 | * |
||
84 | * @param int $value |
||
85 | */ |
||
86 | public function setChunkSize($value) |
||
90 | } |
||
91 |