[Catalyst] [RFC] Loading Plugins from lib/MyApp/Plugins

Christopher H. Laco claco at chrislaco.com
Thu Dec 20 15:21:37 GMT 2007


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.
> =

> -=3DChris

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 =3D 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....

   $class->log->debug( "Loaded components:\n" . $t->draw . "\n" )

happens after

   setup_components

etc...

Aside from that...just loading plugins from ::Plugin or ::P works, along
with the same search_extra kinds of things setup_components does. Justs
needs tests and pod.

-=3DChris	=


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071220/9a00=
c6c9/signature.pgp


More information about the Catalyst mailing list