<commit_before><?php

function setCacheExpiry($entriesCount , $feedId)
{
$expiry = null;

$expiryArr = kConf::hasMap("v3cache_getfeed_expiry") ? kConf::getMap("v3cache_getfeed_expiry") : array();
foreach($expiryArr as $item)
{
	if ($item["key"] == "partnerId" && $item["value"] == kCurrentContext::$partner_id ||
		$item["key"] == "feedId" && $item["value"] == $feedId)
	{
		$expiry = $item["expiry"];
		break;
	}
}

if (!$expiry)
{
	if (kConf::hasParam("v3cache_getfeed_default_cache_time_frame"))
		$expiry = kConf::get("v3cache_getfeed_default_cache_time_frame");
	else
		$expiry = 86400;

	if(kConf::hasParam("v3cache_getfeed_short_limits_array"))
		$shortLimits = kConf::get("v3cache_getfeed_short_limits_array");
	else
		$shortLimits = array(50 => 900 , 100 => 1800 , 200 => 3600 , 400 => 7200);

	foreach ($shortLimits as $numOfEntries => $cacheTimeFrame)
	{
		if ($entriesCount <= $numOfEntries)
		{
			$expiry = min($expiry , $cacheTimeFrame);
			break;
		}
	}
}

KalturaResponseCacher::setExpiry($expiry);
}

function getRequestParameter($paramName)
{
	if (isset($_GET[$paramName]))
		return $_GET[$paramName];

	// try lowercase
	$paramName = strtolower($paramName);
	if (isset($_GET[$paramName]))
		return $_GET[$paramName];
	
	return null;<commit_msg>return instead of break in for loop<commit_after><?php

function setCacheExpiry($entriesCount , $feedId)
{
$expiryArr = kConf::hasMap("v3cache_getfeed_expiry") ? kConf::getMap("v3cache_getfeed_expiry") : array();
foreach($expiryArr as $item)
{
	if ($item["key"] == "partnerId" && $item["value"] == kCurrentContext::$partner_id ||
		$item["key"] == "feedId" && $item["value"] == $feedId)
	{
		KalturaResponseCacher::setExpiry($item["expiry"]);
		return;
	}
}

$expiry = kConf::get("v3cache_getfeed_default_cache_time_frame" , 'local' , 86400);

if(kConf::hasParam("v3cache_getfeed_short_limits_array"))
	$shortLimits = kConf::get("v3cache_getfeed_short_limits_array");
else
	$shortLimits = array(50 => 900 , 100 => 1800 , 200 => 3600 , 400 => 7200);

foreach ($shortLimits as $numOfEntries => $cacheTimeFrame)
{
	if ($entriesCount <= $numOfEntries)
		$expiry = min($expiry , $cacheTimeFrame);
}

KalturaResponseCacher::setExpiry($expiry);

}

function getRequestParameter($paramName)
{
	if (isset($_GET[$paramName]))
		return $_GET[$paramName];

	// try lowercase
	$paramName = strtolower($paramName);
	if (isset($_GET[$paramName]))
		return $_GET[$paramName];
	
	return null;
{'fraction_non_alphanumeric': 0.1775317753177532, 'fraction_numerical': 0.02993029930299303, 'mean_word_length': 6.601246105919003, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '7183033', 'n_tokens_mistral': 1011, 'n_tokens_neox': 910, 'n_words': 148}