private function makeFollowAdapter($parts) {
    // re-use $this if we just got a path or the host/proto info matches
    if(empty($parts['host']) ||
        ($parts['host'] == $this->host &&
          $parts['port'] == $this->port &&
          $parts['scheme'] == $this->proto
        )
    ) {
      return $this;
    }

    if(empty($parts['port'])) {
      $parts['port'] = ($parts['scheme'] == 'https') ? 443 : 5984;
    }

    $adapter = new SagCURLHTTPAdapter($parts['host'], $parts['port']);
    $adapter->useSSL($parts['scheme'] == 'https');
    $adapter->setTimeoutsFromArray($this->getTimeouts());

    return $adapter;
  }
private function makeFollowAdapter($parts) {
    // re-use $this if we just got a path or the host/proto info matches
    if(empty($parts['host']) ||
        ($parts['host'] == $this->host &&
          $parts['port'] == $this->port &&
          $parts['scheme'] == $this->proto
        )
    ) {
      return $this;
    }

    if(empty($parts['port'])) {
      $parts['port'] = ($parts['scheme'] == 'https') ? 443 : 5984;
    }

    $adapter = new SagCURLHTTPAdapter($parts['host'], $parts['port']);
    $adapter->useSSL($parts['scheme'] == 'https');
    $adapter->setTimeoutsFromArray($this->getTimeouts());

    return $adapter;
  }
private function makeFollowAdapter ( $ parts ) { // re-use $this if we just got a path or the host/proto info matches if ( empty ( $ parts [ 'host' ] ) || ( $ parts [ 'host' ] == $ this -> host && $ parts [ 'port' ] == $ this -> port && $ parts [ 'scheme' ] == $ this -> proto ) ) { return $ this ; } if ( empty ( $ parts [ 'port' ] ) ) { $ parts [ 'port' ] = ( $ parts [ 'scheme' ] == 'https' ) ? 443 : 5984 ; } $ adapter = new SagCURLHTTPAdapter ( $ parts [ 'host' ] , $ parts [ 'port' ] ) ; $ adapter -> useSSL ( $ parts [ 'scheme' ] == 'https' ) ; $ adapter -> setTimeoutsFromArray ( $ this -> getTimeouts ( ) ) ; return $ adapter ; }
Used when we need to create a new adapter to follow a redirect because
cURL can't.

@param array $parts Return value from url_parts() for the location header.
@return SagCURLHTTPAdapter Returns $this if talking to the same server
with the same protocol, otherwise creates a new instance.
Used when we need to create a new adapter to follow a redirect because cURL can t .