Re: Image_Transform thoughts
| From: | Dan Allen | Date: | Mon, 20 May 2002 22:01:30 +0000 |
| Subject: | Re: Image_Transform thoughts | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6242@lists.php.net to get a copy of this message | ||
I really like Stig's comments here. What would be nice is if we
could introduce this in the coding standards, since we don't want
the outside world to have any blatant excuses for pointing out holes
in the standard. But then again, I am just a stickler for
standards...
Dan
Stig S. Bakken (ssb@fast.no) wrote:
> 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
--
It is not enough to succeed.
Others must fail.
-- Gore Vidal