Skip to content

Instantly share code, notes, and snippets.

@dermotw
Created October 8, 2012 12:53
Show Gist options
  • Save dermotw/3852367 to your computer and use it in GitHub Desktop.
Save dermotw/3852367 to your computer and use it in GitHub Desktop.
Using SofaSoGood
<?php
require( 'sofasogood.class.php' );
$cdbConn = new sofasogood();
$cdbConn->cdbUser = 'user';
$cdbConn->cdbPass = 'pass';
$cdbConn->cdbHost = 'localhost'; // defaults to localhost
$cdbConn->cdbPort = '5984'; // defaults to 5984
print_r( $cdbConn->cdbPut( '/demo_db' ) );
print_r( $cdbConn->cdbPut( '/demo_db/a_document', '{"name":"A Document", "author":"Dermo"}' ) );
print_r( $cdbConn->cdbGet( '/demo_db/a_document' ) );
print_r( $cdbConn->cdbDelete( '/demo_db' ) );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment