Пример #1
0
		<td width="40%"></td>
		<td width="60%">
			<?=GetMessage("PULL_OPTIONS_NGINX_VERSION_034_DESC")?>
		</td>
	</tr>
	<tr>
		<td width="40%"></td>
		<td width="60%"></td>
	</tr>
	<tr>
		<td><?=GetMessage("PULL_OPTIONS_PATH_TO_PUBLISH")?>:</td>
		<td><input id="config_path_to_publish" type="text" size="40" value="<?=htmlspecialcharsbx(CPullOptions::GetPublishUrl())?>" name="path_to_publish" <?=(CPullOptions::GetQueueServerStatus()? '':'disabled="true"')?>></td>
	</tr>
	<tr>
		<td align="right" width="50%"><?=GetMessage("PULL_OPTIONS_NGINX_BUFFER")?>:</td>
		<td><input id="config_nginx_command_per_hit" type="text" size="10" value="<?=CPullOptions::GetCommandPerHit()?>" name="nginx_command_per_hit" <?=(CPullOptions::GetQueueServerStatus() && CPullOptions::GetQueueServerVersion() > 1? '':'disabled="true"')?>></td>
	</tr>
	<tr>
		<td width="40%"></td>
		<td width="60%">
			<?=GetMessage("PULL_OPTIONS_NGINX_BUFFERS_DESC")?>
		</td>
	</tr>
	<tr>
		<td width="40%"></td>
		<td width="60%"></td>
	</tr>
	<tr>
		<td ><?=GetMessage("PULL_OPTIONS_PATH_TO_LISTENER")?>:</td>
		<td><input id="config_path_to_listener" type="text" size="40" value="<?=htmlspecialcharsbx(CPullOptions::GetListenUrl())?>" name="path_to_listener" <?=(CPullOptions::GetQueueServerStatus()? '':'disabled="true"')?>></td>
	</tr>
Пример #2
0
	public static function Send($channelId, $message, $method = 'POST', $timeout = 5, $dont_wait_answer = true)
	{
		$result_start = '{"infos": ['; $result_end = ']}';
		if (is_array($channelId) && CPullOptions::GetQueueServerVersion() == 1)
		{
			$results = Array();
			foreach ($channelId as $channel)
			{
				$results[] = self::SendCommand($channel, $message, $method, $timeout, $dont_wait_answer);
			}
			$result = json_decode($result_start.implode(',', $results).$result_end);
		}
		else if (is_array($channelId))
		{
			$commandPerHit = CPullOptions::GetCommandPerHit();
			if (count($channelId) > $commandPerHit)
			{
				$arGroup = Array();
				$i = 0;
				foreach($channelId as $channel)
				{
					if (count($arGroup[$i]) == $commandPerHit)
						$i++;

					$arGroup[$i][] = $channel;
				}
				$results = Array();
				foreach($arGroup as $channels)
				{
					$result = self::SendCommand($channels, $message, $method, $timeout, $dont_wait_answer);
					$subresult = json_decode($result);
					$results = array_merge($results, $subresult->infos);
				}
				$result = json_decode('{"infos":'.json_encode($results).'}');
			}
			else
			{
				$result = self::SendCommand($channelId, $message, $method, $timeout, $dont_wait_answer);
				$result = json_decode($result);
			}
		}
		else
		{
			$result = self::SendCommand($channelId, $message, $method, $timeout, $dont_wait_answer);
			$result = json_decode($result_start.$result.$result_end);
		}

		return $result;
	}
Пример #3
0
:</td>
		<td><input id="config_path_to_publish" type="text" size="40" value="<?php 
echo htmlspecialcharsbx(CPullOptions::GetPublishUrl());
?>
" name="path_to_publish" <?php 
echo CPullOptions::GetQueueServerStatus() ? '' : 'disabled="true"';
?>
></td>
	</tr>
	<tr>
		<td align="right" width="50%"><?php 
echo GetMessage("PULL_OPTIONS_NGINX_BUFFER");
?>
:</td>
		<td><input id="config_nginx_command_per_hit" type="text" size="10" value="<?php 
echo CPullOptions::GetCommandPerHit();
?>
" name="nginx_command_per_hit" <?php 
echo CPullOptions::GetQueueServerStatus() && CPullOptions::GetQueueServerVersion() > 1 ? '' : 'disabled="true"';
?>
></td>
	</tr>
	<tr>
		<td width="40%"></td>
		<td width="60%">
			<?php 
echo GetMessage("PULL_OPTIONS_NGINX_BUFFERS_DESC");
?>
		</td>
	</tr>
	<tr class="heading">