<commit_before><?php

/**
 * @package plugins.game
 */
class GamePlugin extends KalturaPlugin implements IKalturaServices
{
	const PLUGIN_NAME = 'game';
	
	public static function isAllowedPartner($partnerId)
	{
		if (PermissionPeer::isValidForPartner(PermissionName::GAME_PLUGIN_PERMISSION, $partnerId))
			return true;
		
		$partner = PartnerPeer::retrieveByPK($partnerId);
		if ($partner)
		{
			return $partner->getPluginEnabled(self::PLUGIN_NAME);
		}
		
		return false;
	}
	
	/* (non-PHPdoc)
	* @see IKalturaServices::getServicesMap()
	*/
	public static function getServicesMap()
	{
		$map = array(
			'userScore' => 'UserScoreService',
		);
		return $map;
	}
	
	/* (non-PHPdoc)
     * @see IKalturaPlugin::getPluginName()
     */
	public static function getPluginName()
	{
		return self::PLUGIN_NAME;
	}
	
	/**
	 * @param $valueName
	 * @return string external API value of dynamic enum.
	 */
	public static function getApiValue($valueName)
	{
		return self::getPluginName() . IKalturaEnumerator::PLUGIN_VALUE_DELIMITER . $valueName;
	}
	
	/**
	 * @return kInfraRedisCacheWrapper
	 * @throws Exception
	 */
	public static function initGameServicesRedisInstance()
	{
		$redisWrapper = new kInfraRedisCacheWrapper();
		$redisConfig = kConf::get(self::PLUGIN_NAME, kConfMapNames::REDIS, null);
		if (!$redisConfig)
		{
			return null;
		}
		
		$configOptions = array(
			'host' => true,
			'port' => false,
			'timeout' => true,
			'cluster' => true,
			'persistent' => true,
			'password' => <PASSWORD>,
			'scheme' => false
		);
		
		$config = array();
		foreach ($configOptions as $option => $isRequired)
		{
			if ($isRequired && !isset($redisConfig[$option]))
			{
				return null;<commit_msg>PLAT-23631: Added message for missing config<commit_after><?php

/**
 * @package plugins.game
 */
class GamePlugin extends KalturaPlugin implements IKalturaServices
{
	const PLUGIN_NAME = 'game';
	
	public static function isAllowedPartner($partnerId)
	{
		if (PermissionPeer::isValidForPartner(PermissionName::GAME_PLUGIN_PERMISSION, $partnerId))
			return true;
		
		$partner = PartnerPeer::retrieveByPK($partnerId);
		if ($partner)
		{
			return $partner->getPluginEnabled(self::PLUGIN_NAME);
		}
		
		return false;
	}
	
	/* (non-PHPdoc)
	* @see IKalturaServices::getServicesMap()
	*/
	public static function getServicesMap()
	{
		$map = array(
			'userScore' => 'UserScoreService',
		);
		return $map;
	}
	
	/* (non-PHPdoc)
     * @see IKalturaPlugin::getPluginName()
     */
	public static function getPluginName()
	{
		return self::PLUGIN_NAME;
	}
	
	/**
	 * @param $valueName
	 * @return string external API value of dynamic enum.
	 */
	public static function getApiValue($valueName)
	{
		return self::getPluginName() . IKalturaEnumerator::PLUGIN_VALUE_DELIMITER . $valueName;
	}
	
	/**
	 * @return kInfraRedisCacheWrapper
	 * @throws Exception
	 */
	public static function initGameServicesRedisInstance()
	{
		$redisWrapper = new kInfraRedisCacheWrapper();
		$redisConfig = kConf::get(self::PLUGIN_NAME, kConfMapNames::REDIS, null);
		if (!$redisConfig)
		{
			return null;
		}
		
		$configOptions = array(
			'host' => true,
			'port' => false,
			'timeout' => true,
			'cluster' => true,
			'persistent' => true,
			'password' => <PASSWORD>,
			'scheme' => false
		);
		
		$config = array();
		foreach ($configOptions as $option => $isRequired)
		{
			if ($isRequired && !isset($redisConfig[$option]))
			{
				KalturaLog::info("Missing in redis configuration: $option");
				return null;
{'fraction_non_alphanumeric': 0.13922241280731848, 'fraction_numerical': 0.001429388221841052, 'mean_word_length': 4.04178674351585, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '1434005', 'n_tokens_mistral': 1342, 'n_tokens_neox': 1191, 'n_words': 241}