[Catalyst] [RFC] Loading Plugins from lib/MyApp/Plugins
Matt S Trout
dbix-class at trout.me.uk
Fri Dec 21 18:55:17 GMT 2007
On Thu, Dec 20, 2007 at 10:21:37AM -0500, Christopher H. Laco wrote:
> Christopher Laco wrote:
> > I know I've been down this thread before. When writing a framework that
> > generates customized Catalyst apps, it would be a whole lot easier
> > (well, more proper) to add plugins in lib/MyApp/Plugins, just like we do
> > with controllers/models/view, than it is to molest the MyApp.pm 'use
> > Catalyst' line to include custom plugins.
> >
> > I'm assuming that it's just a matter of tweaking the Module::Pluggable
> > search paths at the appropriate time when Cat is starting up.
> >
> > Is this a planned feature for 5.8? Could it be?
> > Yes, I'll volunteer to put some tuits on it if need be.
> >
> > -=Chris
>
> Just for giggles this morning, I started tinkering with a
> Catalyst::Plugin::PluginLoader.
>
> Can anyone in core tell me why things are in this particular order?
>
> setup {
> $class->setup_plugins
> $class->log->debug( "Loaded plugins:\n" . $t->draw . "\n" );
> ...
> # Call plugins setup
> {
> no warnings qw/redefine/;
> local *setup = sub { };
> $class->setup;
> }
> }
>
>
> Since PluginLoader->setup is called after the Debug "loaded plugins"
> output...it doesn't show the plugins just loaded by PluginLoader.
>
> Is there some reason these are backwords on purpose, or is that just a
> bug? It appears that other things are ok....
Can't see a reason really, except maybe "what if we die loading a plugin", but
then you'll get an error anyway.
Unless somebody else objects I'd say patch it.
--
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/
More information about the Catalyst
mailing list