예제 #1
0
 private function configureCurl($email, $password)
 {
     curl_setopt_array($this->cURL, array(CURLOPT_URL => $this->url, CURLOPT_HEADER => true, CURLOPT_HTTPHEADER => $this->headers, CURLOPT_RETURNTRANSFER => true));
     if (!StringUtilities::isNullOrEmpty($email) && !StringUtilities::isNullOrEmpty($password)) {
         curl_setopt_array($this->cURL, array(CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_USERPWD => $email . ":" . $password));
     }
 }
예제 #2
0
 /**
  * Fetch a dataset based on a resource ID.
  *
  * @param  string|SoqlQuery $filterOrSoqlQuery A simple filter or a SoqlQuery to filter the results
  *
  * @see    SodaClient::enableAssociativeArrays()
  * @see    SodaClient::disableAssociativeArrays()
  *
  * @since  0.1.0
  *
  * @return array The data set as a PHP array. The array will contain associative arrays or stdClass objects from
  *               the decoded JSON received from the data set.
  */
 public function getDataset($filterOrSoqlQuery = "")
 {
     $headers = array();
     if (!$filterOrSoqlQuery instanceof SoqlQuery && StringUtilities::isNullOrEmpty($filterOrSoqlQuery)) {
         $filterOrSoqlQuery = new SoqlQuery();
     }
     $dataset = $this->urlQuery->sendGet($filterOrSoqlQuery, $this->sodaClient->associativeArrayEnabled(), $headers);
     // Only set the API version number if it hasn't been set yet
     if ($this->apiVersion == 0) {
         $this->apiVersion = self::parseApiVersion($headers);
     }
     return $dataset;
 }
예제 #3
0
 /**
  * @dataProvider validStrings
  *
  * @param  string  $string  The string being tested to check if it's null or whitespace
  */
 public function testIsNullOfEmptyWithValidStrings($string)
 {
     $this->assertFalse(StringUtilities::isNullOrEmpty($string));
 }
예제 #4
0
 /**
  * Fetch a dataset based on a resource ID.
  *
  * @param  string|SoqlQuery $filterOrSoqlQuery A simple filter or a SoqlQuery to filter the results
  *
  * @see    SodaClient::enableAssociativeArrays()
  * @see    SodaClient::disableAssociativeArrays()
  *
  * @since  0.1.0
  *
  * @return array The data set as a PHP array. The array will contain associative arrays or stdClass objects from
  *               the decoded JSON received from the data set.
  */
 public function getDataset($filterOrSoqlQuery = "")
 {
     $headers = array();
     if (!$filterOrSoqlQuery instanceof SoqlQuery && StringUtilities::isNullOrEmpty($filterOrSoqlQuery)) {
         $filterOrSoqlQuery = new SoqlQuery();
     }
     $dataset = $this->urlQuery->sendGet($filterOrSoqlQuery, $this->sodaClient->associativeArrayEnabled(), $headers);
     $this->setApiVersion($headers);
     return $dataset;
 }