Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-38

Change connect() signature to take a URL.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 1.0
    • 1.0
    • None
    • Security Level: Public
    • None

    Description

      Since we are connecting to a REST endpoint, I think it is most sane to let the user supply a URL when doing a connection to Couchbase:

      couchbase_connect($url); and new Couchbase($url);

      An $url would be parsed into

      http[s]://[user:pass@]hostname[:port][/bucketname]

      i.e. $proto = http / $user = null / $pass = null / $host / $port = 8091 / $bucket = default

      The only required part is the hostname

      $proto is null | (string) http | (string)https
      $user is null | (string) username
      $pass is null | (string) password
      $host is (string) hostname or IP
      $port is null | (int) TCP port
      $bucket us null | (string) bucket name

      if $proto is != null, append ://
      if $user is != null, append : and require pass to be != null, append $pass, append @
      if $port is != null, prepend :
      if $bucket is != null, prepend /

      I hope this covers all cases.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            laruence Xinchen Hui
            jan Jan Lehnardt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty