3 namespace Abraham\TwitterOAuth;
6 * Handle setting and storing config for TwitterOAuth.
8 * @author Abraham Williams <abraham@abrah.am>
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;
17 * Decode JSON Response as associative Array
19 * @see http://php.net/manual/en/function.json-decode.php
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 = [];
29 /** @var bool Whether to encode the curl requests with gzip or not */
30 protected $gzipEncoding = true;
32 /** @var integer Size for Chunked Uploads */
33 protected $chunkSize = 250000; // 0.25 MegaByte
36 * Set the connection and response timeouts.
38 * @param int $connectionTimeout
41 public function setTimeouts($connectionTimeout, $timeout)
43 $this->connectionTimeout = (int)$connectionTimeout;
44 $this->timeout = (int)$timeout;
50 public function setDecodeJsonAsArray($value)
52 $this->decodeJsonAsArray = (bool)$value;
56 * @param string $userAgent
58 public function setUserAgent($userAgent)
60 $this->userAgent = (string)$userAgent;
66 public function setProxy(array $proxy)
68 $this->proxy = $proxy;
72 * Whether to encode the curl requests with gzip or not.
74 * @param boolean $gzipEncoding
76 public function setGzipEncoding($gzipEncoding)
78 $this->gzipEncoding = (bool)$gzipEncoding;
82 * Set the size of each part of file for chunked media upload.
86 public function setChunkSize($value)
88 $this->chunkSize = (int)$value;