1 |
<? |
<? |
2 |
|
/** |
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 |
// --------------------------------------------------------------------------- |
// --------------------------------------------------------------------------- |
13 |
// $Id$ |
// $Id$ |
14 |
// --------------------------------------------------------------------------- |
// --------------------------------------------------------------------------- |
15 |
// $Log$ |
// $Log$ |
16 |
|
// Revision 1.7 2003/03/10 22:58:48 joko |
17 |
|
// + fixed metadata for phpDocumentor |
18 |
|
// |
19 |
|
// Revision 1.6 2003/03/05 11:59:34 joko |
20 |
|
// renamed method |
21 |
|
// |
22 |
|
// Revision 1.5 2003/03/03 21:11:01 joko |
23 |
|
// mungled the namespaces |
24 |
|
// |
25 |
|
// Revision 1.4 2003/03/01 04:58:02 joko |
26 |
|
// shifted four methods one more level to concreteness |
27 |
|
// |
28 |
|
// Revision 1.3 2003/02/28 04:16:19 joko |
29 |
|
// fix: getStatus now return status in bool |
30 |
|
// |
31 |
|
// Revision 1.2 2003/02/27 14:37:56 jonen |
32 |
|
// + added function 'saveObjectByGuid()' |
33 |
|
// |
34 |
// Revision 1.1 2003/02/22 16:19:38 joko |
// Revision 1.1 2003/02/22 16:19:38 joko |
35 |
// + initial commit |
// + initial commit |
36 |
// |
// |
37 |
// --------------------------------------------------------------------------- |
// --------------------------------------------------------------------------- |
38 |
|
|
39 |
|
|
40 |
|
/** |
41 |
|
* --- Application::AbstractBackend |
42 |
|
* |
43 |
|
* @author Andreas Motl <andreas.motl@ilo.de> |
44 |
|
* @package org.netfrag.glib |
45 |
|
* @subpackage Application |
46 |
|
* @name Application::AbstractBackend |
47 |
|
* |
48 |
|
*/ |
49 |
class Application_AbstractBackend { |
class Application_AbstractBackend { |
50 |
|
|
51 |
var $rpcinfo; |
var $rpcinfo; |
70 |
// -------------------- clone this & modify ---------- |
// -------------------- clone this & modify ---------- |
71 |
$rpcinfo = $this->rpcinfo; |
$rpcinfo = $this->rpcinfo; |
72 |
//$rpcinfo[to_latin] = 1; // FIXME! implement this into Data::Driver::RPC::Remote! |
//$rpcinfo[to_latin] = 1; // FIXME! implement this into Data::Driver::RPC::Remote! |
73 |
$resultHandle = mkObject('Data::Driver::Proxy', $cache_key, array( key => 1, command => $command, query => $query, remote => 1, rpcinfo => $rpcinfo, cache => array( db => 0, session => 1 ) ) ); |
$resultHandle = mkObject('DesignPattern::RemoteProxy', $cache_key, array( key => 1, command => $command, query => $query, remote => 1, rpcinfo => $rpcinfo, cache => array( db => 0, session => 1 ) ) ); |
74 |
$result = $resultHandle->getAttributes(); |
$result = $resultHandle->getResult(); |
75 |
|
//print Dumper($result); exit; |
76 |
return $result; |
return $result; |
77 |
// -------------------- clone this & modify ---------- |
// -------------------- clone this & modify ---------- |
78 |
|
|
79 |
} |
} |
80 |
|
|
|
function getObjectList() { |
|
|
return $this->_remote_method('getObjectList'); |
|
|
} |
|
|
|
|
|
function getObjects($obj_type) { |
|
|
return $this->_remote_method('getObjects', $obj_type); |
|
|
} |
|
|
|
|
|
function getObjectByGuid($obj_guid, $classname) { |
|
|
return $this->_remote_method('getObjectByGuid', array('guid' => $obj_guid, 'classname' => $classname)); |
|
|
} |
|
|
|
|
81 |
function getStatus() { |
function getStatus() { |
82 |
global $app; |
global $app; |
83 |
//print Dumper($app); |
$proxy = mkObject('DesignPattern::RemoteProxy', null, array( remote => 1, rpcinfo => $app->getConfig("rpcinfo") ) ); |
84 |
$proxy = mkObject('Data::Driver::Proxy', null, array( remote => 1, rpcinfo => $app->getConfig("rpcinfo") ) ); |
return $proxy->backend->isConnected(); |
|
//print Dumper($proxy); |
|
|
$status_bool = $proxy->backend->isConnected(); |
|
|
$status_yesno = $status_bool ? 'yes' : 'no'; |
|
|
return $status_yesno; |
|
85 |
} |
} |
86 |
|
|
87 |
function forceConnect() { |
function forceConnect() { |
88 |
global $app; |
global $app; |
89 |
//print Dumper($app); |
//print Dumper($app); |
90 |
$proxy = mkObject('Data::Driver::Proxy', null, array( remote => 1, rpcinfo => $app->getConfig("rpcinfo"), connect => 1 ) ); |
$proxy = mkObject('DesignPattern::RemoteProxy', null, array( remote => 1, rpcinfo => $app->getConfig("rpcinfo"), connect => 1 ) ); |
91 |
//print Dumper($proxy); |
//print Dumper($proxy); |
92 |
$proxy->backend->ping(); |
$proxy->backend->ping(); |
93 |
$status_bool = $proxy->backend->isConnected(); |
$status_bool = $proxy->backend->isConnected(); |