4 * Copyright (c) 2007 Jerry Jalava <jerry.jalava@gmail.com>
5 * Licensed under the GPLv3 license
6 * http://www.gnu.org/licenses/gpl.html
10 class couchdb_databases_database
extends couchdb_transport
16 public function __construct($name, $configuration)
20 throw new couchdb_database_exception('No database name given!');
23 $configuration['database'] = $name;
24 parent
::__construct($configuration);
28 $this->view
= new couchdb_views($configuration);
29 $this->document
= new couchdb_documents($configuration);
32 public function &exists()
34 $this->execute(false);
35 return $this;//($this->lastStatusCode == 200);
38 public function create()
40 return $this->execute(false, 'PUT');
43 public function delete()
45 return $this->execute(false, 'DELETE');
48 public function clear_caches()
50 $this->view
->clear_caches();
51 $this->document
->clear_caches();