19 require_once(BASE.
"wcmf/lib/util/class.Log.php");
20 require_once(BASE.
"wcmf/lib/presentation/class.Request.php");
21 require_once(BASE.
"wcmf/lib/presentation/class.Response.php");
47 $this->_serverCli = realpath($serverCli);
48 if (!file_exists($this->_serverCli))
56 if (($this->_php = $parser->getValue(
'php',
'system')) ===
false)
59 $parser->getErrorMsg(), __FILE__, __LINE__);
64 if (!$session->exist(self::SIDS_SESSION_VARNAME)) {
66 $session->set(self::SIDS_SESSION_VARNAME, $var);
90 if (!$isLogin && $sessionId == null) {
101 $serializedRequest = base64_encode(serialize($request));
107 $currentDir = getcwd();
108 chdir(dirname($this->_serverCli));
110 Log::debug(
"Do remote call to: ".$this->_serverCli, __CLASS__);
111 Log::debug(
"Request:\n".$request->toString(), __CLASS__);
114 session_write_close();
115 exec($this->_php.
' '.$this->_serverCli.
' '.join(
' ', $arguments), $jsonResponse, $returnValue);
118 Log::debug(
"Response [JSON]:\n".$jsonResponse[0], __CLASS__);
123 $response =
new Response(
'',
'',
'', $responseData);
127 Log::debug(
"Response:\n".$response->toString(), __CLASS__);
130 if (!$response->getValue(
'success')) {
132 if (strpos(
'Authorization failed', $response->getValue(
'errorMsg')) === 0 && !$isLogin) {
155 'login' => $this->_user->getLogin(),
156 'password' => $this->_user->getPassword(),
157 'password_is_encrypted' => true
161 if ($response->getValue(
'success'))
179 $sids = $session->get(self::SIDS_SESSION_VARNAME);
181 $session->set(self::SIDS_SESSION_VARNAME, $sids);
191 $sids = $session->get(self::SIDS_SESSION_VARNAME);
192 if (isset($sids[$this->_serverCli])) {
203 $errorMsg = $response->getValue(
'errorMsg');
204 Log::error(
"Error in remote call to ".$this->_serverCli.
": ".$errorMsg.
"\n".$response->toString(), __FILE__, __LINE__);
error($message, $category)
debug($message, $category)
RPCClient is used to do calls to other wCMF instances on the same maschine.
Request holds the request values that are used as input to Controller instances. It is typically inst...
throwEx($message, $file='', $line='')
static decode($value, $assoc=false)
__construct($serverCli, $user)
isDebugEnabled($category)
const SIDS_SESSION_VARNAME
Response holds the response values that are used as output from Controller instances. It is typically instantiated by the ActionMapper instance and filled during Controller execution.
doRemoteCall($request, $isLogin)