API Stream Wrappers – Week 4

This was a very productive week… personally. Three weddings and the associated road trips 🙂 Project wise, I have started on the base WordPress stream wrapper interface. This interface will be implemented by all stream wrappers that want to interact with the stream wrappers plugin and is an extension of PHP’s example stream wrapper class.

One item of particular interest is that PHP’s fopen() function only supports URIs in the form of “scheme://target”. This despite the fact that RFC 3986 states that a URI’s scheme component delimiter is in general “:” and not “://”. For the sake of consistency the WordPress stream wrappers plugin will only accept URIs in full form (i.e. “scheme://target” rather than “scheme:target”). Here’s a rather dated PHP bug report of the problem if this kind of stuff interests you.

I’m shuffling around some of the items on the timeline so that development can proceed more smoothly. Primarily, I’m going to create a generic stream wrapper for the local filesystem and get it out of the way now. This wrapper will be bundled with the core stream wrapper plugin. It will serve as an example implementation for developers of other stream wrappers (more on that later) and provide a convenient method of building tests.