InitWebRequest() static private method

Initializes the script context for a web request.
/// Web configuration is invalid. The context is not initialized then. ///
static private InitWebRequest ( PHP.Core.ApplicationContext appContext, HttpContext context ) : ScriptContext
appContext PHP.Core.ApplicationContext Application context.
context System.Web.HttpContext HTTP context of the request.
return ScriptContext
Esempio n. 1
0
        /// <summary>
        /// Initializes the context.
        /// </summary>
        private void Initialize(ApplicationContext /*!*/ appContext)
        {
            Debug.Assert(appContext != null);

            defaultResponseEncoding = httpContext.Response.ContentEncoding;

            scriptContext            = ScriptContext.InitWebRequest(appContext, httpContext);
            TrackClientDisconnection = !scriptContext.Config.RequestControl.IgnoreUserAbort;

            // Session is ended after destructing objects since PHP 5.0.5, use two-phase finalization:
            scriptContext.TryDispose += () =>
            {
                this.TryDisposeBeforeFinalization();     // ends session

                // finalize objects created during session closing and output finalization:
                this.scriptContext.GuardedCall <object, object>(this.scriptContext.FinalizePhpObjects, null, false);

                // Platforms-specific dispose
                this.TryDisposeAfterFinalization();      // flushes headers
            };

            // Platforms-specific finally dispose
            scriptContext.FinallyDispose += FinallyDispose;

            //
            if (RequestBegin != null)
            {
                RequestBegin();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes the context.
        /// </summary>
        private void Initialize(ApplicationContext /*!*/ appContext)
        {
            Debug.Assert(appContext != null);

            defaultResponseEncoding = httpContext.Response.ContentEncoding;

            scriptContext            = ScriptContext.InitWebRequest(appContext, httpContext);
            TrackClientDisconnection = !scriptContext.Config.RequestControl.IgnoreUserAbort;

            if (RequestBegin != null)
            {
                RequestBegin();
            }
        }