Re: Image_Transform thoughts
| From: | Stig S. Bakken | Date: | Mon, 20 May 2002 21:56:58 +0000 |
| Subject: | Re: Image_Transform thoughts | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6241@lists.php.net to get a copy of this message | ||
On Mon, 2002-05-20 at 18:32, Peter Bowyer wrote:
> At 03:37 AM 5/20/02 -0700, Dan Allen wrote:
> >In order to comply with the somewhat standard structures that have
> >been established in PEAR for directory organization, wouldn't it
> >make sense for Image_Transform to use the Container idea that Log
> >and Auth use for the different "drivers" when organizing the
> >directory structure, such as
> >
> >Image_Transform/
> > Transform.php
> > Container/
> > IM.php
> > GD.php
> > ...etc
> >
> >It seems to me very logical and well thoughtout to do it in this
> >way. Does anyone feel the same/object?
>
> I'm open to any such suggestions. One arrangement I had been thinking of was:
>
> Image_Transform/
> Image_Transform.php
> Drivers/
> IM.php
> GD.php
> NetPBM.php
> ...etc
>
> but if your ones are the standard PEAR naming system then it would be
> better to stick to using that.
There's no standard for this, only precedence. "Container" is not a
very good name for this in Image_Transform anyway. "Driver" is better
IMHO.
> Also, in the PEAR packages does everything get installed into its own
> directory as per the CVS setup, or are the Image_* items expected to end up
> in one directory?
The rule of thumb is that the file Foo/Bar.php defines the Foo_Bar
class. Here's one suggestion:
Image_Transform/Transform.php -> Image/Transform.php
Image_Transform/Drivers/IM.php -> Image/Transform/IM.php
or Image_Transform/Drivers/IM.php -> Image/Transform/Drivers/IM.php
I think the second line (Image/Transform/IM.php) works just as well.
Because of the expected correlation between file name and class name,
adding the "Drivers" doesn't seem necessary to me, it would only make
for longer class names and an extra directory (the Image/Transform dir
would only contain "Drivers").
- Stig