Pchp.Library.Streams.StreamWrapper.GetWrapper C# (CSharp) Method

GetWrapper() public static method

Retreive the corresponding StreamWrapper respectind the scheme portion of the given path. If no scheme is specified, an instance of FileStreamWrapper is returned.
In case when the required wrapper can not be found.
public static GetWrapper ( Context ctx, string scheme, StreamOptions options ) : StreamWrapper
ctx Pchp.Core.Context Current runtime context.
scheme string The scheme portion of an URL.
options StreamOptions Additional having effect on the wrapper retreival.
return StreamWrapper
        public static StreamWrapper GetWrapper(Context ctx, string scheme, StreamOptions options)
        {
            StreamWrapper wrapper = GetWrapperInternal(ctx, scheme);

            if (wrapper == null)
            {
                PhpException.Throw(PhpError.Notice, ErrResources.stream_bad_wrapper, scheme);
                // Notice:  fopen(): Unable to find the wrapper "*" - did you forget to enable it when you configured PHP? in C:\Inetpub\wwwroot\php\index.php on line 23

                wrapper = GetWrapperInternal(ctx, "file");
                // There should always be the FileStreamWrapper present.
            }

            // EX [GetWrapper]: check for the other StreamOptions here: for example UseUrl, IgnoreUrl

            //if (!ScriptContext.CurrentContext.Config.FileSystem.AllowUrlFopen)
            //{
            //    if (wrapper.IsUrl)
            //    {
            //        PhpException.Throw(PhpError.Warning, ErrResources.url_fopen_disabled);
            //        return null;
            //    }
            //}

            Debug.Assert(wrapper != null);
            return wrapper;
        }