/** * Make a request to the Bitrix server and returns the result * @param array $action * @return array|bool */ public function receiveData($action) { $payload = $this->getPayload($action, false); if(!$payload) return false; $response = self::sendRequest($payload); if($response) { if(isset($response["new_spd"])) { CUpdateClient::setSpd($response["new_spd"]); } } else { $response = array(); } if(!isset($response["status"])) { $response["status"] = self::REMOTE_STATUS_FATAL_ERROR; $response["error_text"] = GetMessage("SECURITY_SITE_CHECKER_CONNECTION_ERROR"); } return $response; }
/** * Returns action response XML and check CRC * * @param string $action * @return CDataXML * @throws CBitrixCloudException */ protected function backup_action($action) { $obXML = $this->action($action); $node = $obXML->SelectNodes("/control"); if (is_object($node)) { $spd = $node->getAttribute("crc_code"); if (strlen($spd) > 0) { CUpdateClient::setSpd($spd); } } else { throw new CBitrixCloudException(GetMessage("BCL_BACKUP_WS_SERVER", array("#STATUS#" => "-1")), $this->getServerResult()); } return $obXML; }