ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

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

References $ilDB, and $ilLog.

Member Function Documentation

◆ getHost()

ilRPCServerSettings::getHost ( )

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

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 }

References $rpc_host.

Referenced by 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 70 of file class.ilRPCServerSettings.php.

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

References $instance.

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

+ Here is the caller graph for this function:

◆ getPath()

ilRPCServerSettings::getPath ( )

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

119 {
120 return RPC_SERVER_PATH;
121 }
const RPC_SERVER_PATH

References RPC_SERVER_PATH.

◆ getPort()

ilRPCServerSettings::getPort ( )

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

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 }

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 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 ( )

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

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)
Create an XML_RPC2 client instance.

References $ilLog, and ilRpcClientFactory\factory().

+ 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.

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

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.

◆ $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.

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 49 of file class.ilRPCServerSettings.php.


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