Example #1
0
 /**
  * @return APIClient
  */
 public function getClient()
 {
     if (null === $this->client) {
         $this->client = new APIClient(self::URL);
         $this->client->setApiKey(isset($_SERVER['SG_API_KEY']) ? $_SERVER['SG_API_KEY'] : self::DEMO_API_KEY);
         $this->client->setApiSecret(isset($_SERVER['SG_API_SECRET']) ? $_SERVER['SG_API_SECRET'] : self::DEMO_API_SECRET);
     }
     return $this->client;
 }
Example #2
0
 protected function call($call, $args)
 {
     $args = array_merge($this->args, $args);
     if ($this->options['verbose']) {
         $this->output->writeln("Calling: <info>" . $this->client->getFullUrl($call, $args) . "</info>");
     }
     $res = $this->client->call($call, $args);
     if (!$res) {
         $this->error($this->client->getError());
     }
     return $res;
 }