/**
  *
  * @param string $check_word
  * @param string $file_name
  * @return CDataXML
  *
  */
 public function actionWriteFile($check_word, $file_name)
 {
     $this->check_word = "";
     $this->file_name = $file_name;
     $this->spd = CUpdateClient::getSpd();
     return $this->backup_action("write_file");
 }
 /**
  * Returns URL to backup webservice
  *
  * @param array[string]string $arParams
  * @return string
  *
  */
 protected function getActionURL($arParams = array())
 {
     $arParams["license"] = md5(LICENSE_KEY);
     $arParams["spd"] = CUpdateClient::getSpd();
     foreach ($this->addParams as $key => $value) {
         $arParams[$key] = $value;
     }
     $url = COption::GetOptionString("bitrixcloud", "monitoring_policy_url");
     $url = CHTTP::urlAddParams($url, $arParams, array("encode" => true)) . $this->addStr;
     return $url;
 }
	/**
	 * Generate payload for request to Bitrix
	 * @param string $action - "check" or "receive_results"
	 * @param bool $collectSystemInformation
	 * @return string
	 */
	protected function getPayload($action = "check", $collectSystemInformation = true)
	{
		if(!in_array($action, self::$validActions))
			return false;

		$payload = array(
				"action" => $action,
				"host"   => self::getHostName(),
				"lang"   => LANGUAGE_ID,
				"license_key" => self::getLicenseKey(),
				"spd" => CUpdateClient::getSpd(),
				"testing_token" => $this->checkingToken
			);
		if($collectSystemInformation || $action === "check")
			$payload["system_information"] = base64_encode(serialize(self::getSystemInformation()));
		return $payload;
	}
示例#4
0
 /**
  *
  * @return CDataXML
  * @throws CBitrixCloudException
  */
 public function actionGetBackupJob()
 {
     $this->addStr = "";
     $this->addParams = array("spd" => CUpdateClient::getSpd());
     return $this->backup_action("get_backup_job");
 }
示例#5
0
 /**
  *
  * @return CDataXML
  * @throws CBitrixCloudException
  */
 public function actionGetBackupJob()
 {
     $this->addStr = "";
     $this->addParams = array("spd" => CUpdateClient::getSpd(), "CHHB" => $_SERVER["HTTP_HOST"], "CSAB" => $_SERVER["SERVER_ADDR"]);
     return $this->backup_action("get_backup_job");
 }