/[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.4 - (show annotations)
Sat Mar 1 04:58:02 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
Changes since 1.3: +4 -17 lines
shifted four methods one more level to concreteness

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

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