Re: Package Scope Recommendations for File_Ogg

From: Date: Thu, 14 Aug 2003 16:25:36 +0000
Subject: Re: Package Scope Recommendations for File_Ogg
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19754@lists.php.net to get a copy of this message
> David Grant wrote: >> So to clarify: >> function foo() >> { > ... >> Correct? > In this style yes. For your package i would suggest a kind of factory > function, ie File_Ogg::file() which could returns a File_Ogg_PHP object > if no extension is found or File_Ogg_Wrapper if an OggVorbis-Extension > exists - as is named it is just a wrapper for the extension. That's a sound idea, and one that'll certainly save a load of processing. Is there a common standard for this type of thing within PEAR, and what do you recommend doing for all the inheriting classes, such as File_Ogg_Vorbis? I intend to use File_Ogg to provide access to instances of the various inheriting classes corresponding to the logical streams found inside an Ogg file. Should I also write a series of wrappers for these particular logical bitstreams? e.g. $x = File_Ogg::file("foo.ogg") returns an instance of File_Ogg_PECL if the extensions is loaded. $x->getLogicalStream(1) returns an instance of File_Ogg_Vorbis_PECL? Right? This package just keeps getting bigger! To think that once I had only thought of extracting the comments from an Ogg Vorbis file. Now we have multiple streams and wrapper classes for as-yet non-existant PECL extension! And with no guarantee of the work being accepted into PEAR either! :) Still, it's all good fun. :P Regards, David

« previous php.pear.dev (#19754) next »