ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilRPCServerSettings Class Reference
+ Collaboration diagram for ilRPCServerSettings:

Public Member Functions

 isEnabled ()
 Returns true if server ip and port are set. More...
 
 getServerUrl ()
 
 getHost ()
 
 setHost ($a_host)
 
 getPort ()
 
 setPort ($a_port)
 
 getPath ()
 
 update ()
 
 pingServer ()
 

Static Public Member Functions

static getInstance ()
 Get singelton instance. More...
 

Data Fields

 $rpc_host = ''
 
 $rpc_port = ''
 
 $log = null
 
 $db = null
 
 $err = null
 
 $settings_obj = null
 

Private Member Functions

 __construct ()
 Singleton contructor. More...
 

Static Private Attributes

static $instance = null
 

Detailed Description

Definition at line 37 of file class.ilRPCServerSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilRPCServerSettings::__construct ( )
private

Singleton contructor.

Returns

Definition at line 56 of file class.ilRPCServerSettings.php.

References $ilDB, and $ilLog.

57  {
58  global $ilLog,$ilDB,$ilError,$ilias;
59 
60  $this->log =& $ilLog;
61  $this->db =& $ilDB;
62  $this->err =& $ilError;
63  $this->ilias =& $ilias;
64  }
redirection script todo: (a better solution should control the processing via a xml file) ...
global $ilDB

Member Function Documentation

◆ getHost()

ilRPCServerSettings::getHost ( )

Definition at line 94 of file class.ilRPCServerSettings.php.

References $rpc_host.

Referenced by isEnabled(), and update().

95  {
96  if(strlen($this->rpc_host))
97  {
98  return $this->rpc_host;
99  }
100  return $this->rpc_host = $this->ilias->getSetting('rpc_server_host');
101  }
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the caller graph for this function:

◆ getInstance()

static ilRPCServerSettings::getInstance ( )
static

Get singelton instance.

Returns
object $ilRPCServerSettings

Definition at line 70 of file class.ilRPCServerSettings.php.

Referenced by ilRpcClientFactory\factory(), ilSurveyEditorGUI\printViewObject(), and ilObjSearchSettingsGUI\saveSettingsObject().

71  {
72  if(self::$instance)
73  {
74  return self::$instance;
75  }
76  return self::$instance = new ilRPCServerSettings();
77  }
+ Here is the caller graph for this function:

◆ getPath()

ilRPCServerSettings::getPath ( )

Definition at line 118 of file class.ilRPCServerSettings.php.

References RPC_SERVER_PATH.

119  {
120  return RPC_SERVER_PATH;
121  }
const RPC_SERVER_PATH

◆ getPort()

ilRPCServerSettings::getPort ( )

Definition at line 106 of file class.ilRPCServerSettings.php.

References $rpc_port.

Referenced by getServerUrl(), isEnabled(), and update().

107  {
108  if(strlen($this->rpc_port))
109  {
110  return $this->rpc_port;
111  }
112  return $this->rpc_port = $this->ilias->getSetting('rpc_server_port');
113  }
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the caller graph for this function:

◆ getServerUrl()

ilRPCServerSettings::getServerUrl ( )

Definition at line 88 of file class.ilRPCServerSettings.php.

References getPort(), and RPC_SERVER_PATH.

89  {
90  return 'http://'.$this->getHost().':'.$this->getPort().'/'.RPC_SERVER_PATH;
91  }
const RPC_SERVER_PATH
+ Here is the call graph for this function:

◆ isEnabled()

ilRPCServerSettings::isEnabled ( )

Returns true if server ip and port are set.

Returns
bool

Definition at line 83 of file class.ilRPCServerSettings.php.

References getHost(), and getPort().

84  {
85  return strlen($this->getHost()) and strlen($this->getPort());
86  }
+ Here is the call graph for this function:

◆ pingServer()

ilRPCServerSettings::pingServer ( )

Definition at line 131 of file class.ilRPCServerSettings.php.

References $ilLog, and ilRpcClientFactory\factory().

132  {
133  include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
134 
135  try
136  {
137  ilRpcClientFactory::factory('RPCebug')->ping();
138  return true;
139  }
140  catch(Exception $e)
141  {
142  $ilLog->write(__METHOD__.': '.$e->getMessage());
143  return false;
144  }
145  }
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
+ Here is the call graph for this function:

◆ setHost()

ilRPCServerSettings::setHost (   $a_host)

Definition at line 102 of file class.ilRPCServerSettings.php.

103  {
104  $this->rpc_host = $a_host;
105  }

◆ setPort()

ilRPCServerSettings::setPort (   $a_port)

Definition at line 114 of file class.ilRPCServerSettings.php.

115  {
116  $this->rpc_port = $a_port;
117  }

◆ update()

ilRPCServerSettings::update ( )

Definition at line 123 of file class.ilRPCServerSettings.php.

References getHost(), and getPort().

124  {
125  $this->ilias->setSetting('rpc_server_host',$this->getHost());
126  $this->ilias->setSetting('rpc_server_port',$this->getPort());
127 
128  return true;
129  }
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilRPCServerSettings::$db = null

Definition at line 46 of file class.ilRPCServerSettings.php.

◆ $err

ilRPCServerSettings::$err = null

Definition at line 47 of file class.ilRPCServerSettings.php.

◆ $instance

ilRPCServerSettings::$instance = null
staticprivate

Definition at line 39 of file class.ilRPCServerSettings.php.

◆ $log

ilRPCServerSettings::$log = null

Definition at line 45 of file class.ilRPCServerSettings.php.

◆ $rpc_host

ilRPCServerSettings::$rpc_host = ''

Definition at line 42 of file class.ilRPCServerSettings.php.

Referenced by getHost().

◆ $rpc_port

ilRPCServerSettings::$rpc_port = ''

Definition at line 43 of file class.ilRPCServerSettings.php.

Referenced by getPort().

◆ $settings_obj

ilRPCServerSettings::$settings_obj = null

Definition at line 49 of file class.ilRPCServerSettings.php.


The documentation for this class was generated from the following file: