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

Christopher H. Laco claco at chrislaco.com
Tue Dec 18 15:33:13 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 to keep the conversation rolling, let's put aside the Plugins
directory for the moment.

If you wanted to load plugins from config, what would you like to see?
What would you need?

1. Load all plugins specifically from config, ignoring what's in
MyApp.pm when specified?

  plugins:
    - ConfigLoader
    - Session
    - Session::State::Cookie
    - Session::Store::File
    - +MyApp::Plugin::Frobnisicate
    - Static::Simple


2. Load plugins from a location?

  plugins:
    path: __path_to(lib, MyApp, Plugins)


3. Prepend/Append plugins to be loaded around MyApp.pm?

    plugins:
      prepend:
        - Debug
      append:
        - Static::Simple
        - +MyApp::Plugin::Foo

-=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/20071218/706c=
181f/signature.pgp


More information about the Catalyst mailing list