3 If you are using an older database backend (one of the ewiki_database_*()
4 functions), then you need to load this plugin wrapper _after_ it, so it
5 still can be accessed by the core using the newer OO interface.
7 Whenever it doesn't work out of the box, do this by hand:
8 $ewiki_db = new ewiki_database_compat("");
9 $ewiki_db->pf = "old_db_function_name";
11 You can probably also use this file as template for converting your
12 database backend to the new scheme.
17 if (!isset($ewiki_db) && isset($ewiki_plugins["database"])) {
18 $ewiki_db = new ewiki_database_compat($ewiki_plugins["database"][0]);
22 #-- compatibility wrapper
23 class ewiki_database_compat {
27 function ewiki_database_compat($pf) {
31 function GET($id, $version=false) {
32 return $this->pf("GET", array("id"=>$id, "version"=>$version));
35 function WRITE($data, $overwrite=0) {
36 $FUNC = $overwrite ? "OVERWRITE" : "WRITE";
37 return $this->pf($FUNC, $data);
41 return $this->pf("HIT", $id);
44 function FIND($list) {
45 return $this->pf("FIND", $list);
48 function GETALL($fields) {
49 return $this->pf("GETALL", $fields);
52 function SEARCH($field, $content, $ci=1, $regex=0, $mask=0, $filter=0) {
53 return $this->pf("SEARCH", array($field=>$content));
56 function DELETE($id, $version) {
57 return $this->pf("DELETE", array("id"=>$id, "version"=>$version));
61 return $this->pf("INIT", array());