So, I was talking with Ralph and we came to the conclusion that everything
I'm doing can be done using streams.
Ah, streams--that dark, deserted, slightly scary corner of the PHP world.
Zend_Stream_Reader seems to be a better fit, name-wise, when you look at
its derivatives.
Zend_Stream_Reader_Interface
Zend_Stream_File_Reader (or Zend_File_Reader?) implements
Zend_Stream_Reader_Interface
Zend_Pdf_Reader extends Zend_Stream_File_Reader
My_Image_Gif_Reader extends Zend_Stream_File_Reader
That way, when we inevitably come up with writers (deriving from
Zend_Stream_Writer), they correspond very obviously:
Zend_Pdf_Writer extends Zend_Stream_File_Writer (Zend_Pdf becomes the
input stream class, extending Zend_File/Zend_Stream_File)
My_Image_Gif_Writer extends Zend_Stream_File_Writer
Streams could then be combined in any number of ways to make reading and
writing very simple and consistent. It also has the added effect of
promoting the use of streams in PHP.
Thoughts?
-Matt