<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Reflection;
using AlienForce.Utilities.DataAnnotations;
using AlienForce.Utilities.DataAnnotations.Resources;
using AlienForce.Utilities.Billing;
using System.ComponentModel;
using AlienForce.Utilities.Logging;
using System.Configuration;

namespace AlienForce.Utilities.Web
{
	public class AlienForceMvcApplication : System.Web.HttpApplication
	{
		static ILog Log = LogFramework.Framework.GetLogger(typeof(AlienForceMvcApplication));

		private static Dictionary<string, bool> _EnvironmentTags = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
		private static bool _DebugEnv;

		/// <summary>
		/// Environment tags can be used for things like 'DEBUG' or 'NOSSL' that control major decisions
		/// about the way the site should operate. This allows attributes to control whether SSL is required,
		/// roles are enforced, and etc.  The tags are pulled from the app setting "AlienForce.EnvironmentTags"
		/// and should be separated by commas.  Tags are case-insensitive.
		/// </summary>
		/// <param name="tag"></param>
		/// <returns></returns>
		public virtual bool HasEnvironmentTag(string tag)
		{
			if (String.Equals(tag, "DEBUG", StringComparison.OrdinalIgnoreCase))
			{
				return _DebugEnv;
			}
			return _EnvironmentTags.ContainsKey(tag);
		}<commit_msg>Added static method to get environment tags<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Reflection;
using AlienForce.Utilities.DataAnnotations;
using AlienForce.Utilities.DataAnnotations.Resources;
using AlienForce.Utilities.Billing;
using System.ComponentModel;
using AlienForce.Utilities.Logging;
using System.Configuration;
using System.Web;

namespace AlienForce.Utilities.Web
{
	public class AlienForceMvcApplication : System.Web.HttpApplication
	{
		static ILog Log = LogFramework.Framework.GetLogger(typeof(AlienForceMvcApplication));

		private static Dictionary<string, bool> _EnvironmentTags = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase);
		private static bool _DebugEnv;

		public static bool AppHasEnvirontmentTag(string tag)
		{
			return ((AlienForceMvcApplication)HttpContext.Current.ApplicationInstance).HasEnvironmentTag(tag);
		}

		/// <summary>
		/// Environment tags can be used for things like 'DEBUG' or 'NOSSL' that control major decisions
		/// about the way the site should operate. This allows attributes to control whether SSL is required,
		/// roles are enforced, and etc.  The tags are pulled from the app setting "AlienForce.EnvironmentTags"
		/// and should be separated by commas.  Tags are case-insensitive.
		/// </summary>
		/// <param name="tag"></param>
		/// <returns></returns>
		public virtual bool HasEnvironmentTag(string tag)
		{
			if (String.Equals(tag, "DEBUG", StringComparison.OrdinalIgnoreCase))
			{
				return _DebugEnv;
			}
			return _EnvironmentTags.ContainsKey(tag);
		}
{'fraction_non_alphanumeric': 0.09575835475578406, 'fraction_numerical': 0.0, 'mean_word_length': 4.851503759398496, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '7378977', 'n_tokens_mistral': 907, 'n_tokens_neox': 852, 'n_words': 255}