public static void RegisterIApplications() { ApplicationStartupHandler.RegisterHandlers(); }
// Initialize only on the first request public void InitializeApplication(HttpApplication HttpApp) { if (s_InitializedAlready) { return; } lock (s_lock) { if (s_InitializedAlready) { return; } // Perform first-request initialization here ... try { LogHelper.Info <requestModule>(string.Format("Application started at {0}", DateTime.Now)); if (UmbracoSettings.AutoCleanLogs) { AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval()); } } catch { } // Trigger startup handlers ApplicationStartupHandler.RegisterHandlers(); // Check for configured key, checking for currentversion to ensure that a request with // no httpcontext don't set the whole app in configure mode if (UmbracoVersion.Current != null && !GlobalSettings.Configured) { HttpApp.Application["umbracoNeedConfiguration"] = true; } /* This section is needed on start-up because timer objects * might initialize before these are initialized without a traditional * request, and therefore lacks information on application paths */ /* Initialize SECTION END */ // add current default url HttpApp.Application["umbracoUrl"] = string.Format("{0}:{1}{2}", HttpApp.Context.Request.ServerVariables["SERVER_NAME"], HttpApp.Context.Request.ServerVariables["SERVER_PORT"], IOHelper.ResolveUrl(SystemDirectories.Umbraco)); // Start ping / keepalive timer pingTimer = new Timer(new TimerCallback(keepAliveService.PingUmbraco), HttpApp.Context, 60000, 300000); // Start publishingservice publishingTimer = new Timer(new TimerCallback(publishingService.CheckPublishing), HttpApp.Context, 30000, 60000); //Find Applications and event handlers and hook-up the events //BusinessLogic.Application.RegisterIApplications(); //define the base settings for the dependency loader to use the global path settings //if (!CompositeDependencyHandler.HandlerFileName.StartsWith(GlobalSettings_Path)) // CompositeDependencyHandler.HandlerFileName = GlobalSettings_Path + "/" + CompositeDependencyHandler.HandlerFileName; // Backwards compatibility - set the path and URL type for ClientDependency 1.5.1 [LK] ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper.FileMapVirtualFolder = "~/App_Data/TEMP/ClientDependency"; ClientDependency.Core.CompositeFiles.Providers.BaseCompositeFileProcessingProvider.UrlTypeDefault = ClientDependency.Core.CompositeFiles.Providers.CompositeUrlType.Base64QueryStrings; // init done... s_InitializedAlready = true; } }