PHP.Core.Configuration.Load C# (CSharp) Method

Load() public static method

Loads configuration and returns configuration record.
Configuration is invalid or incomplete.
public static Load ( PHP.Core.ApplicationContext appContext ) : void
appContext PHP.Core.ApplicationContext
return void
		public static void Load(ApplicationContext/*!*/ appContext)
		{
			if (current == null)
			{
				Debug.Assert(!isBeingLoadedToCurrentThread, "Configuration loader triggered next configuration load");
				isBeingLoadedToCurrentThread = true;

				try
				{
					PhpConfigurationContext context = ConfigurationSectionHandler.GetConfig(appContext, SectionName);

					if (context != null)
					{
						current = new Configuration(context.Global, context.Local);
					}
					else
					{
						// no configuration loaded from .config files:
						current = new Configuration(new GlobalConfiguration(), new LocalConfiguration());
					}
				}
				finally
				{
					isBeingLoadedToCurrentThread = false;
				}
			}
		}