示例#1
0
 /**
  * @param $uri
  * @param array $getParams
  * @param array $postParams
  * @param $user
  * @param $password
  * @return Response
  */
 public static function sendGetWithAuth($uri, array $getParams = [], array $postParams = [], $user, $password)
 {
     $requestHelper = new RequestHelper();
     $guzzle = new Client();
     $httpClient = new HTTPClient($guzzle, $requestHelper);
     $httpHelper = new HttpHelper($httpClient);
     $response = $httpHelper->sendGetWithAuth($uri, $getParams, $postParams, $user, $password);
     return $response;
 }
示例#2
0
 private function checkRepoBitbucketExist()
 {
     $httphelper = new HttpHelper(new HTTPClient(new Client(), new RequestHelper()));
     //$response = $httphelper->sendGet("https://api.bitbucket.org/2.0/repositories/". $this->workbenchSettings->requested["organization"]['valore'] ."/".$this->workbenchSettings->requested["domain"]['valore']);
     $response = $httphelper->sendGetWithAuth("https://api.bitbucket.org/2.0/repositories/" . $this->workbenchSettings->requested["organization"]["valore"] . "/" . $this->workbenchSettings->requested["packagename"]["valore"], [], [], $this->workbenchSettings->requested["user"]["valore"], $this->workbenchSettings->requested["password"]["valore"]);
     return $response->status_code == 200 ? true : false;
 }