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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations)
Mon Mar 10 22:58:48 2003 UTC (21 years, 5 months ago) by joko
Branch: MAIN
Changes since 1.6: +23 -1 lines
+ fixed metadata for phpDocumentor

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

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