[Catalyst-dev] Feature request: post_setup.

Oleg Pronin syber.rus at gmail.com
Tue Dec 25 09:12:15 GMT 2007


I used this technique before. I thought it was a some kinda hack. There is a
bug using setup_finished for 'post_setup' purpose.

We use company-wide framework based on catalyst and MyApp inherits from some
Company::Catalyst and the 'post_setup' logic implemented there in
'setup_finished'.

but setup_finished is an Class::Data::Inheritable accessor. C::D::I
dynamically creates setup_finished subroutine in MyApp on first call
(without '1' parameter) and Company::Catalyst's setup_finished will never be
called after.

2007/12/24, Matt S Trout <dbix-class at trout.me.uk>:
>
> On Sun, Dec 23, 2007 at 08:56:45PM +0300, Oleg Pronin wrote:
> > It is very often and in many applications and plugins needed to do
> something
> > on the setup phase after all of applications models, view etc have been
> > initialized.
> > For example, a dynamic admin interface plugin needs to initialize its
> data
> > using infomation from all avaliable models.
> > The 'setup' callback is called before any model, controller and view
> have
> > been initialized.
> > Therefore it would be cool to add the 'post_setup' callback which will
> be
> > called on application's mixin right before the end of setup:
> >
> > In Catalyst.pm in 'setup' method right before expression:
> >
> >     $class->setup_finished(1);
>
> setup_finished already is this hook. Just wrap that and check for @_ > 1
>
> --
>       Matt S Trout       Need help with your Catalyst or DBIx::Class
> project?
>    Technical Director
> http://www.shadowcat.co.uk/catalyst/
> Shadowcat Systems Ltd.  Want a managed development or deployment platform?
> http://chainsawblues.vox.com/
> http://www.shadowcat.co.uk/servers/
>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20071225/c=
f06d901/attachment.htm


More information about the Catalyst-dev mailing list