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;
}