Adam Carter
Adam Carter

Reputation: 4844

Connect to Cloudant (CouchDB) with PHPillow

PHPillow uses this method to create a connection:

phpillowConnection::createInstance(HOST, PORT_NUMBER, USERNAME, PASSWORD);

However, I am using Cloudant as a CouchDB service, so I need to connect in a slightly different way (using CURL):

curl https://username:[email protected]/_all_dbs

Does anyone have any experience with this?

Upvotes: 2

Views: 436

Answers (1)

garbados
garbados

Reputation: 885

Connecting to Cloudant is just like connecting to CouchDB, so the variables in PHPillow's connection method -- HOST, PORT_NUMBER, USERNAME, and PASSWORD -- work as follows:

  • HOST: [username].cloudant.com
  • PORT_NUMBER: 443 (the default for secure HTTP aka HTTPS)
  • USERNAME: your Cloudant username, or an API key
  • PASSWORD: your Cloudant password, or an API secret

So connecting using PHPillow with an account named fakeuser with the password fakepassword would look like this

phpillowConnection::createInstance("fakeuser.cloudant.com", 443, "fakeuser", "fakepassword");

Does that make sense?

Upvotes: 2

Related Questions