protected function loadCredentials() {
    if (empty($this->mail) || empty($this->key)) {
      if (empty($this->credentialsFile)) {
        $this->credentialsFile = new PhingFile($_SERVER['HOME'] . '/.acquia/cloudapi.conf');
      }

      if (!file_exists($this->credentialsFile) || !is_readable($this->credentialsFile)) {
        throw new BuildException("Acquia Cloud credentials file '{$this->credentialsFile}' is not available.");
      }

      $contents = file_get_contents($this->credentialsFile);
      $creds = json_decode($contents, TRUE);

      $this->mail = $creds['mail'];
      $this->key = $creds['key'];
    }

    if (empty($this->mail) || empty($this->key)) {
      throw new BuildException('Missing Acquia Cloud API credentials.');
    }
  }
protected function loadCredentials() {
    if (empty($this->mail) || empty($this->key)) {
      if (empty($this->credentialsFile)) {
        $this->credentialsFile = new PhingFile($_SERVER['HOME'] . '/.acquia/cloudapi.conf');
      }

      if (!file_exists($this->credentialsFile) || !is_readable($this->credentialsFile)) {
        throw new BuildException("Acquia Cloud credentials file '{$this->credentialsFile}' is not available.");
      }

      $contents = file_get_contents($this->credentialsFile);
      $creds = json_decode($contents, TRUE);

      $this->mail = $creds['mail'];
      $this->key = $creds['key'];
    }

    if (empty($this->mail) || empty($this->key)) {
      throw new BuildException('Missing Acquia Cloud API credentials.');
    }
  }
protected function loadCredentials ( ) { if ( empty ( $ this -> mail ) || empty ( $ this -> key ) ) { if ( empty ( $ this -> credentialsFile ) ) { $ this -> credentialsFile = new PhingFile ( $ _SERVER [ 'HOME' ] . '/.acquia/cloudapi.conf' ) ; } if ( ! file_exists ( $ this -> credentialsFile ) || ! is_readable ( $ this -> credentialsFile ) ) { throw new BuildException ( "Acquia Cloud credentials file '{$this->credentialsFile}' is not available." ) ; } $ contents = file_get_contents ( $ this -> credentialsFile ) ; $ creds = json_decode ( $ contents , TRUE ) ; $ this -> mail = $ creds [ 'mail' ] ; $ this -> key = $ creds [ 'key' ] ; } if ( empty ( $ this -> mail ) || empty ( $ this -> key ) ) { throw new BuildException ( 'Missing Acquia Cloud API credentials.' ) ; } }
Load the Acquia Cloud credentials from the cloudapi.conf JSON file.

@throws \IOException
@throws \NullPointerException
Load the Acquia Cloud credentials from the cloudapi . conf JSON file .