Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 define("RPC_SERVER_PATH","/RPC2");
00035 define("RPC_SERVER_ALIVE",true);
00036
00037 class ilRPCServerSettings
00038 {
00039
00040 var $rpc_host = '';
00041 var $rpc_port = '';
00042
00043 var $log = null;
00044 var $db = null;
00045 var $err = null;
00046
00047 var $settings_obj = null;
00048
00049
00050 function ilRPCServerSettings()
00051 {
00052 global $ilLog,$ilDB,$ilError,$ilias;
00053
00054 $this->log =& $ilLog;
00055 $this->db =& $ilDB;
00056 $this->err =& $ilError;
00057 $this->ilias =& $ilias;
00058 }
00059
00060 function getHost()
00061 {
00062 if(strlen($this->rpc_host))
00063 {
00064 return $this->rpc_host;
00065 }
00066 return $this->rpc_host = $this->ilias->getSetting('rpc_server_host');
00067 }
00068 function setHost($a_host)
00069 {
00070 $this->rpc_host = $a_host;
00071 }
00072 function getPort()
00073 {
00074 if(strlen($this->rpc_port))
00075 {
00076 return $this->rpc_port;
00077 }
00078 return $this->rpc_port = $this->ilias->getSetting('rpc_server_port');
00079 }
00080 function setPort($a_port)
00081 {
00082 $this->rpc_port = $a_port;
00083 }
00084 function getPath()
00085 {
00086 return RPC_SERVER_PATH;
00087 }
00088
00089 function update()
00090 {
00091 $this->ilias->setSetting('rpc_server_host',$this->getHost());
00092 $this->ilias->setSetting('rpc_server_port',$this->getPort());
00093
00094 return true;
00095 }
00096
00097 function pingServer()
00098 {
00099 include_once 'Services/Search/classes/Lucene/class.ilLuceneRPCAdapter.php';
00100
00101 $rpc_adapter =& new ilLuceneRPCAdapter();
00102 $rpc_adapter->setMode('ping');
00103 $res = $rpc_adapter->send();
00104
00105 if($res == RPC_SERVER_ALIVE)
00106 {
00107 return true;
00108 }
00109 return false;
00110 }
00111 }
00112 ?>