3 Remote ewiki databases can be accessed using the PHP-RPC protocol
4 (more lightweight and magnitudes faster than XML-RPC). But you must
5 first create an interface on the remote server:
9 include("plugins/lib/phprpc.php");
10 $passwords = array("accessname" => "password");
11 include("fragments/funcs/auth.php");
12 // define("EWIKI_DB_LOCK", 0);
13 phprpc_server(array("ewiki_db"));
16 Give this a name of "z-db.php" or so, and give its absolute URL in
17 the EWIKI_DB_RPC constant here. You must load plugins/lib/phprpc.php
21 define("EWIKI_DB_RPC", "http://name:pw@rpc.example.com/ewiki/z-db.php");
24 class ewiki_database_rpc {
26 function ewiki_ddatabase_rpc($url=EWIKI_DB_RPC) {
31 function GET($id, $version) {
32 return phprpc($this->url, "ewiki_db::GET", array($id, $version));
35 function WRITE($hash, $overwrite) {
36 return phprpc($this->url, "ewiki_db::WRITE", array($hash, $overwrite));
43 function FIND($list) {
44 return phprpc($this->url, "ewiki_db::FIND", array($list));
47 function GETALL($fields, $msk, $filt) {
48 return phprpc($this->url, "ewiki_db::GETALL", array($fields, $msk, $filt));
51 function SEARCH($field, $content, $ci, $regex, $mask, $filter) {
52 return phprpc($this->url, "ewiki_db::SEARCH", array($field, $content, $ci, $regex, $mask, $filter));
55 function DELETE($id, $version) {
56 return phprpc($this->url, "ewiki_db::DELETE", array($id, $version));
60 return phprpc($this->url, "ewiki_db::INIT", array());