Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 45 lines (35 sloc) 1.43 kb
4e5e5dc7 » Arin Sarkissian
2009-05-15 wuddup
1 CouchDB Library coming soon...
2
fcad0694 » Arin Sarkissian
2009-05-15 update readme
3 SETUP:
253c9723 » Arin Sarkissian
2009-05-15 start getting the DB api working
4
fcad0694 » Arin Sarkissian
2009-05-15 update readme
5 * install CouchDB & start it ;-)
6 * make sure you have the Duckk_SimpleHTTP/ folder from Duckk_SimpleHttp in your include_path
7 * download that from http://github.com/phatduckk/Duckk_SimpleHTTP/tree/master
8 * download this package and make sure you have the Duckk_CouchDB/ folder from Duckk_CouchDB in your include_path
9 * download this from http://github.com/phatduckk/Duckk_CouchDB/tree/master
10
8c918def » Arin Sarkissian
2009-05-15 update readme
11 You include_path will look something like
fcad0694 » Arin Sarkissian
2009-05-15 update readme
12 PEAR/
13 YourIncPath/
14 Duckk_CouchDB/
15 Duckk_SimpleHTTP/
16
17 echo get_include_path();
78468c3d » Arin Sarkissian
2009-05-15 more better readme
18 // someStuff:Duckk_CouchDB:Duckk_SimpleHTTP:YourIncPath:PEAR
19
20 ---------------------------- EXAMPLE ------------------------------
21 $couchdb = new Duckk_CouchDB();
22 $randomDBName = 'testing' . md5(microtime(true));
23
24 print_r($couchdb->getDatabases());
25 // shows array of db names
26
27 var_dump($couchdb->createDatabase($randomDBName));
28 // should return TRUE assuming $randomDBName doesnt exist
29
30 try {
31 $couchdb->createDatabase($randomDBName);
32 } catch (Exception $e) {
33 print_r($e);
34 // should print the exception cuz we already created $randomDBName
35 }
36
37 var_dump($couchdb->deleteDatabase($randomDBName));
38 // should return TRUE cuz it successfully deleted $randomDBName
39
40 try {
41 $couchdb->deleteDatabase($randomDBName);
42 } catch (Exception $e) {
43 print_r($e);
44 // should print the exception cuz $randomDBName no longer exists
45 }
Something went wrong with that request. Please try again.