Ejemplo n.º 1
0
 public function perform($url)
 {
     $curl = new Curl();
     $curl->setTimeout(30);
     $curl->setProxy($this->proxy);
     $browser = new Browser($curl);
     return $this->serializer->decode($browser->post($url)->getContent(), 'xml');
 }
Ejemplo n.º 2
0
 /**
  * Class constructor.
  *
  * @param string $consumerKey
  * @param string $consumerSecret
  * @param string|null $accessToken
  * @param string|null $accessTokenSecret
  * @param string|null $apiUrl
  * @param string|null $proxy
  * @param int|null $timeout
  */
 public function __construct($consumerKey, $consumerSecret, $accessToken = null, $accessTokenSecret = null, $apiUrl = null, $proxy = null, $timeout = null)
 {
     $this->consumerKey = $consumerKey;
     $this->consumerSecret = $consumerSecret;
     $this->accessToken = $accessToken;
     $this->accessTokenSecret = $accessTokenSecret;
     $this->apiUrl = $apiUrl ?: self::BASE_URL . '/1.1/';
     $curl = new Curl();
     $curl->setTimeout($timeout);
     $curl->setProxy($proxy);
     $this->browser = new Browser($curl);
 }