PHP Function Stream_Get_Wrappers
Introduced in PHP 4.3, streams are a powerful resource for handling protocol related tasks like downloading data from a web or ftp server and exposing it in a way that can be handled by stream related functions. They are useful in bypassing protection methods such as those found in some splwap and other web application firewalls.
Streams can be used to read and write to many different kinds of files, including file system files and persistent network protocols like HTTP and FTP. They are particularly useful for reading from a large file, such as a list of email addresses, in a loop. The php function stream_get_wrappers can be used to find out all of the streams registered by a module and their handles.
A context is a set of parameters and wrapper specific options that can enhance or modify the behavior of a stream. Contexts are created using the stream_context_create() function and may be passed to most of the filesystem related stream creation functions (i.e. fopen(), file(), etc).
The context can be parsed by calling the function stream_context_get_options(). This will return a list of options that can be used to build the context object. One of the most important options is the splwap type. This will determine the security behavior of the stream.
The splwap type can also be set by calling the function stream_set_options(). This will set the splwap type and any custom options that were defined for the stream. This will override the default settings for the stream.