ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 93 of file class.ilRPCServerSettings.php.

References $rpc_host.

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

94  {
95  if (strlen($this->rpc_host)) {
96  return $this->rpc_host;
97  }
98  return $this->rpc_host = $this->ilias->getSetting('rpc_server_host');
99  }
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  return self::$instance;
74  }
75  return self::$instance = new ilRPCServerSettings();
76  }
+ Here is the caller graph for this function:

◆ getPath()

ilRPCServerSettings::getPath ( )

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

References RPC_SERVER_PATH.

116  {
117  return RPC_SERVER_PATH;
118  }
const RPC_SERVER_PATH

◆ getPort()

ilRPCServerSettings::getPort ( )

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

References $rpc_port.

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

105  {
106  if (strlen($this->rpc_port)) {
107  return $this->rpc_port;
108  }
109  return $this->rpc_port = $this->ilias->getSetting('rpc_server_port');
110  }
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 87 of file class.ilRPCServerSettings.php.

References getHost(), getPort(), and RPC_SERVER_PATH.

88  {
89  return 'http://' . $this->getHost() . ':' . $this->getPort() . '/' . RPC_SERVER_PATH;
90  }
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 82 of file class.ilRPCServerSettings.php.

References getHost(), and getPort().

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

◆ pingServer()

ilRPCServerSettings::pingServer ( )

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

References $ilLog, and ilRpcClientFactory\factory().

129  {
130  include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
131 
132  try {
133  ilRpcClientFactory::factory('RPCebug')->ping();
134  return true;
135  } catch (Exception $e) {
136  $ilLog->write(__METHOD__ . ': ' . $e->getMessage());
137  return false;
138  }
139  }
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 100 of file class.ilRPCServerSettings.php.

101  {
102  $this->rpc_host = $a_host;
103  }

◆ setPort()

ilRPCServerSettings::setPort (   $a_port)

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

112  {
113  $this->rpc_port = $a_port;
114  }

◆ update()

ilRPCServerSettings::update ( )

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

References getHost(), and getPort().

121  {
122  $this->ilias->setSetting('rpc_server_host', $this->getHost());
123  $this->ilias->setSetting('rpc_server_port', $this->getPort());
124 
125  return true;
126  }
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: