src/Robo/Commands/Generate/AliasesCommand.php
protected function setCloudApiClient($key, $secret) {
    try {
      $connector = new Connector(array(
        'key' => $key,
        'secret' => $secret,
      ));
      $cloud_api = Client::factory($connector);
      // We must call some method on the client to test authentication.
      $cloud_api->applications();
      $this->cloudApiClient = $cloud_api;
      return $cloud_api;
    }
    catch (\Exception $e) {
      // @todo this is being thrown after first auth. still works? check out.
      $this->logger->error('Failed to authenticate with Acquia Cloud API.');
      $this->logger->error('Exception was thrown: ' . $e->getMessage());
      return NULL;
    }
  }
protected function setCloudApiClient($key, $secret) {
    try {
      $connector = new Connector(array(
        'key' => $key,
        'secret' => $secret,
      ));
      $cloud_api = Client::factory($connector);
      // We must call some method on the client to test authentication.
      $cloud_api->applications();
      $this->cloudApiClient = $cloud_api;
      return $cloud_api;
    }
    catch (\Exception $e) {
      // @todo this is being thrown after first auth. still works? check out.
      $this->logger->error('Failed to authenticate with Acquia Cloud API.');
      $this->logger->error('Exception was thrown: ' . $e->getMessage());
      return NULL;
    }
  }
protected function setCloudApiClient ( $ key , $ secret ) { try { $ connector = new Connector ( array ( 'key' => $ key , 'secret' => $ secret , ) ) ; $ cloud_api = Client :: factory ( $ connector ) ; // We must call some method on the client to test authentication. $ cloud_api -> applications ( ) ; $ this -> cloudApiClient = $ cloud_api ; return $ cloud_api ; } catch ( \ Exception $ e ) { // @todo this is being thrown after first auth. still works? check out. $ this -> logger -> error ( 'Failed to authenticate with Acquia Cloud API.' ) ; $ this -> logger -> error ( 'Exception was thrown: ' . $ e -> getMessage ( ) ) ; return NULL ; } }
Tests CloudAPI client authentication credentials.

@param string $key
The Acquia token public key.
@param string $secret
The Acquia token secret key.

@return array
Returns credentials as array on success, or NULL on failure.
Tests CloudAPI client authentication credentials .