Exemplo n.º 1
0
 /**
  * Constructor
  *
  * Sets up the Summon API Client
  *
  * @param string $apiId   Summon API ID
  * @param string $apiKey  Summon API Key
  * @param array  $options Associative array of additional options; legal keys:
  *    <ul>
  *      <li>authedUser - is the end-user authenticated?</li>
  *      <li>debug - boolean to control debug mode</li>
  *      <li>host - base URL of Summon API</li>
  *      <li>sessionId - Summon session ID to apply</li>
  *      <li>version - API version to use</li>
  *    </ul>
  */
 public function __construct($apiId, $apiKey, $options = array())
 {
     $config = ConfigReader::getConfig('Summon');
     // Store preferred boolean behavior:
     if (!isset($options['caseSensitiveBooleans']) && isset($config->General->case_sensitive_bools)) {
         $this->caseSensitiveBooleans = $config->General->case_sensitive_bools;
     } else {
         $this->caseSensitiveBooleans = $options['caseSensitiveBooleans'];
     }
     // Set default snippet behavior if necessary:
     if (isset($config->General->snippets)) {
         $this->snippets = $config->General->snippets;
     }
     $timeout = isset($config->General->timeout) ? $config->General->timeout : 30;
     parent::__construct($apiId, $apiKey, $options, new HttpClient(null, array('timeout' => $timeout)));
 }