Development of stream wrappers is progressing nicely and on track with the timeline. Today I have a very small treat: visuals.
The following organizational chart shows the current state of the plugin.
The WP Local Stream Wrapper Base class provides an implementation of the wrapper interface class and is capable of manipulating local files. In essence, this base implementation provides functionality equivalent to the file:// wrapper that comes with PHP.
Any wrapper that manipulates local files can simply extend this base class. This means that it only takes a few lines of code to implement a custom wrapper fully capable of manipulating local files [e.g. mysuperdupercoollongwrappername:// (please don’t ever make your wrapper scheme this long)].
Did you know: paths such as /path/to/file.txt use the PHP Filesystem (file://) wrapper?
The chart below is a demonstration of the organization when other community developed stream wrappers are added.
At the present time, only the local:// stream wrapper will be included with the plugin. Other [optional] stream wrappers will be implemented as individual plugins. This method will make it easier to add and remove wrappers at will and find them in the repository.
However, one small stumbling block has been encountered. WordPress does not currently do anything with plugin dependencies. Until this functionality is made available with the core plugin system, each wrapper will have to perform a rudimentary check to assert that the WP Stream Wrappers Plugin is activated before trying to load a wrapper implementation which extends the WP Stream Wrapper Interface. Otherwise, universe ending paradoxes will ensue.
Until next week 🙂
hakre 2:14 pm on August 31, 2010 Permalink |
I love Stream Wrapper. Thanks for taking care. I thought to write something that hooks on file:// just by default … 🙂
Jon Stacey 10:53 pm on October 10, 2012 Permalink |
That’s odd… I just got an email notification of your comment today… Yep, 2 years behind schedule.
Wish I could spend more time on this, [school/life/loans and whatnot]. If you need to make any changes or find bugs in the code be sure to send a pull request on GitHub and I’ll get it incorporated at least. And if you have a plugin which depends on this one update the wiki to mention it.
Cheers!