• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/WebServices/RPC/classes/class.ilRPCServerSettings.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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 ?>

Generated on Fri Dec 13 2013 10:18:31 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1