/[cvs]/nfo/php/libs/org.netfrag.glib/Application/AbstractBackend.php
ViewVC logotype

Contents of /nfo/php/libs/org.netfrag.glib/Application/AbstractBackend.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations)
Wed Mar 5 11:59:34 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
Changes since 1.5: +6 -2 lines
renamed method

1 <?
2 // ---------------------------------------------------------------------------
3 // $Id: AbstractBackend.php,v 1.5 2003/03/03 21:11:01 joko Exp $
4 // ---------------------------------------------------------------------------
5 // $Log: AbstractBackend.php,v $
6 // Revision 1.5 2003/03/03 21:11:01 joko
7 // mungled the namespaces
8 //
9 // Revision 1.4 2003/03/01 04:58:02 joko
10 // shifted four methods one more level to concreteness
11 //
12 // Revision 1.3 2003/02/28 04:16:19 joko
13 // fix: getStatus now return status in bool
14 //
15 // Revision 1.2 2003/02/27 14:37:56 jonen
16 // + added function 'saveObjectByGuid()'
17 //
18 // Revision 1.1 2003/02/22 16:19:38 joko
19 // + initial commit
20 //
21 // ---------------------------------------------------------------------------
22
23
24 class Application_AbstractBackend {
25
26 var $rpcinfo;
27
28 function Application_AbstractBackend($rpcinfo) {
29 $this->rpcinfo = $rpcinfo;
30 // debug
31 //print Dumper($this->rpcinfo);
32 }
33
34 function _remote_method() {
35 $arg_list = func_get_args();
36
37 $command = array_shift($arg_list);
38
39 $cache_key = join("-", array(session_id(), $command, join('_', $arg_list) ));
40 //print "cache_key: $cache_key<br>";
41
42 // FIXME: what if arg_list still contains more elements after doing this?
43 $query = array_shift($arg_list);
44
45 // -------------------- clone this & modify ----------
46 $rpcinfo = $this->rpcinfo;
47 //$rpcinfo[to_latin] = 1; // FIXME! implement this into Data::Driver::RPC::Remote!
48 $resultHandle = mkObject('DesignPattern::RemoteProxy', $cache_key, array( key => 1, command => $command, query => $query, remote => 1, rpcinfo => $rpcinfo, cache => array( db => 0, session => 1 ) ) );
49 $result = $resultHandle->getResult();
50 //print Dumper($result); exit;
51 return $result;
52 // -------------------- clone this & modify ----------
53
54 }
55
56 function getStatus() {
57 global $app;
58 $proxy = mkObject('DesignPattern::RemoteProxy', null, array( remote => 1, rpcinfo => $app->getConfig("rpcinfo") ) );
59 return $proxy->backend->isConnected();
60 }
61
62 function forceConnect() {
63 global $app;
64 //print Dumper($app);
65 $proxy = mkObject('DesignPattern::RemoteProxy', null, array( remote => 1, rpcinfo => $app->getConfig("rpcinfo"), connect => 1 ) );
66 //print Dumper($proxy);
67 $proxy->backend->ping();
68 $status_bool = $proxy->backend->isConnected();
69 $status_yesno = $status_bool ? 'yes' : 'no';
70 return $status_yesno;
71 }
72
73 }
74
75 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed