The php Function Stream_Filter_Register
Streams are a fundamental part of the PHP language. They are used for everything from moving files around a network to reading and writing data line by line.
Using streams lets you do many things, but one thing that people tend to overlook is the power of filtering. With the php function stream_filter_register you can add your own custom filters to any stream.
The built in filters that come with PHP are very useful, but sometimes you need more specialized filtering. The php function stream_filter_register() allows you to register user designed wrappers that can be attached to any registered stream that is used with all of the filesystem functions like fopen(), fread() etc.
You will need to create a class that extends the php_user_filter and implement its methods as described in the manual page for stream_filter_register(). This class will need to have a constructor function and a method called onCreate(). The constructor function will need to pass the class object for which it is creating a filter for. The method onCreate() needs to return the filter's callback function if the constructor returned success or an error code if not.
The php function stream_filter_register() also has other methods. The prepend(resource