ILIAS  release_7 Revision v7.30-3-g800a261c036
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
 
 $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 55 of file class.ilRPCServerSettings.php.

56 {
57 global $DIC;
58
59 $ilDB = $DIC['ilDB'];
60 $ilias = $DIC['ilias'];
61
62 $this->log = $DIC->logger()->wsrv();
63 $this->db = $ilDB;
64 $this->ilias = $ilias;
65 }
global $DIC
Definition: goto.php:24
redirection script todo: (a better solution should control the processing via a xml file)
global $ilDB

References $DIC, and $ilDB.

Member Function Documentation

◆ getHost()

ilRPCServerSettings::getHost ( )

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

95 {
96 if (strlen($this->rpc_host)) {
97 return $this->rpc_host;
98 }
99 return $this->rpc_host = $this->ilias->getSetting('rpc_server_host');
100 }

References $rpc_host.

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

+ Here is the caller graph for this function:

◆ getInstance()

static ilRPCServerSettings::getInstance ( )
static

Get singelton instance.

Returns
object $ilRPCServerSettings

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

72 {
73 if (self::$instance) {
74 return self::$instance;
75 }
76 return self::$instance = new ilRPCServerSettings();
77 }

References $instance.

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

+ Here is the caller graph for this function:

◆ getPath()

ilRPCServerSettings::getPath ( )

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

117 {
118 return RPC_SERVER_PATH;
119 }
const RPC_SERVER_PATH

References RPC_SERVER_PATH.

◆ getPort()

ilRPCServerSettings::getPort ( )

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

106 {
107 if (strlen($this->rpc_port)) {
108 return $this->rpc_port;
109 }
110 return $this->rpc_port = $this->ilias->getSetting('rpc_server_port');
111 }

References $rpc_port.

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

+ Here is the caller graph for this function:

◆ getServerUrl()

ilRPCServerSettings::getServerUrl ( )

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

89 {
90 return 'http://' . $this->getHost() . ':' . $this->getPort() . '/' . RPC_SERVER_PATH;
91 }

References getHost(), getPort(), and 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.

84 {
85 return strlen($this->getHost()) and strlen($this->getPort());
86 }

References getHost(), and getPort().

+ Here is the call graph for this function:

◆ pingServer()

ilRPCServerSettings::pingServer ( )
Returns
bool

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

133 {
134 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
135
136 try {
137 ilRpcClientFactory::factory('RPCebug')->ping();
138 return true;
139 } catch (Exception $e) {
140 $this->log->warning('Calling RPC server failed with message: ' . $e->getMessage());
141 return false;
142 }
143 }
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.

References Vendor\Package\$e, and ilRpcClientFactory\factory().

+ Here is the call graph for this function:

◆ setHost()

ilRPCServerSettings::setHost (   $a_host)

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

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

◆ setPort()

ilRPCServerSettings::setPort (   $a_port)

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

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

◆ update()

ilRPCServerSettings::update ( )

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

122 {
123 $this->ilias->setSetting('rpc_server_host', $this->getHost());
124 $this->ilias->setSetting('rpc_server_port', $this->getPort());
125
126 return true;
127 }

References getHost(), and getPort().

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilRPCServerSettings::$db = null

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

◆ $instance

ilRPCServerSettings::$instance = null
staticprivate

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

Referenced by getInstance().

◆ $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 48 of file class.ilRPCServerSettings.php.


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