<commit_before><?php
require_once(dirname(__FILE__).'/../bootstrap.php');

if ($argc < 4)
	die ("Required parameters not received. Run script in the following format: php setPartnerBroadcastingUrls.php {partnerId} {parimary broadcast URL} {HTTP playback URL} [{secondary broadcast URL}] [{HTTPS playback URL}]");

$partnerId = $argv[1];
$primaryBroadcatUrl =  $argv[2];
$httpPlaybackUrl = $argv[3];

$secondaryBroadcastUrl = null;
if (isset($argv[4]))
	$secondaryBroadcastUrl = $argv[4];
	
$httpsPlaybackUrl = null;
if (isset($argv[5]))
	$httpsPlaybackUrl = $argv[5];

$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner)
{
	die ("Partner with id {$partnerId} not found.");
}

$partner->setBroadcastUrlManager('kPartnerBroadcastUrlManager');
$partner->setPrimaryBroadcastUrl($primaryBroadcatUrl);
$partner->setSecondaryBroadcastUrl($secondaryBroadcastUrl);

$liveStreamConfigurations = array ('http' => $httpPlaybackUrl);
$liveStreamConfigurations = array ('https' => $httpsPlaybackUrl);
$partner->setLiveStreamPlaybackUrlConfigurations($liveStreamConfigurations);
$partner->save();
<commit_msg>Add arguments validations: 1. Enable excluding secondaryBroadcstingUrl. 2. Validate https playback url was provided before setting its value.<commit_after><?php
require_once(dirname(__FILE__).'/../bootstrap.php');

if ($argc < 4)
	die ("Required parameters not received. Run script in the following format: php setPartnerBroadcastingUrls.php {partnerId} {parimary broadcast URL} {HTTP playback URL} [{secondary broadcast URL}] [{HTTPS playback URL}]");

$partnerId = $argv[1];
$primaryBroadcatUrl =  $argv[2];
$httpPlaybackUrl = $argv[3];

$secondaryBroadcastUrl = null;
if (isset($argv[4]) && $argv[4] != 0)
	$secondaryBroadcastUrl = $argv[4];
	
$httpsPlaybackUrl = null;
if (isset($argv[5]))
	$httpsPlaybackUrl = $argv[5];

$partner = PartnerPeer::retrieveByPK($partnerId);
if (!$partner)
{
	die ("Partner with id {$partnerId} not found.");
}

$partner->setBroadcastUrlManager('kPartnerBroadcastUrlManager');
$partner->setPrimaryBroadcastUrl($primaryBroadcatUrl);
$partner->setSecondaryBroadcastUrl($secondaryBroadcastUrl);

$liveStreamConfigurations = array ('http' => $httpPlaybackUrl);
if($httpsPlaybackUrl)
	$liveStreamConfigurations = array ('https' => $httpsPlaybackUrl);

$partner->setLiveStreamPlaybackUrlConfigurations($liveStreamConfigurations);
$partner->save();

{'fraction_non_alphanumeric': 0.1506504406210659, 'fraction_numerical': 0.00839278220730172, 'mean_word_length': 8.204633204633204, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7314433', 'n_tokens_mistral': 764, 'n_tokens_neox': 751, 'n_words': 166}