[Catalyst-dev] [Patch] Catalyst::View::Email configuration

J. Shirley jshirley at gmail.com
Fri Jul 13 18:40:56 GMT 2007


On 7/13/07, Daniel Westermann-Clark <dwc at pobox.com> wrote:
> On 2007-07-11 22:02:14 -0400, Daniel Westermann-Clark wrote:
> > I was playing around with Catalyst::View::Email and ran into some
> > problems configuring it via a configuration file (as opposed to
> > __PACKAGE__->config).
> >
> > The problem was that View::Email was not storing the configuration
> > passed in from ConfigLoader.  The attached patch simply stores the
> > configuration at the beginning of new.  (This seems to be a relatively
> > common idiom, but I'd be happy to correct it if it's wrong.)
>
> Thanks to mst, I've learned this is in fact wrong.  :)
>
> Setting config at the beginning of new like this modifies class data.
> Any instance will see the changes, which is not always desirable.
>
> The correct solution is to create accessors for your config keys and
> use those throughout:
>
> http://dev.catalystframework.org/svnweb/Catalyst/revision/?rev=6525
>
> --
> Daniel Westermann-Clark
>

Bumped C::V::Email to 0.03 with the "right" method of doing this.

Thanks guys.

-- 
J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
http://www.toeat.com



More information about the Catalyst-dev mailing list