tags:

views:

53

answers:

2

I'm working on some large Catalyst codebase which doesn't have a seperate config file. However, in the main module it does have things like:

__PACKAGE__->config(
    name => 'Example::Server',
    encoding => 'UTF-8',
    ...
);

So I was hoping I could just add the SmartURI config there, like this:

__PACKAGE__->config(
    name => 'Example::Server',
    encoding => 'UTF-8',
    'Plugin::SmartURI' => { 'disposition' => 'hostless' },
);

But it looks like that's not enough to load or enable it.

So, I'm obviously missing something, any help appreciated.

ps. The plugin + deps have been installed through CPAN.

+1  A: 

Unless I'm mistaken you configure it like this:

__PACKAGE__->config(
    name        => 'Example::Server',
    encoding    => 'UTF-8',
    smarturi => {
        disposition => 'hostless',
    },
);

I had to look in the source code of the plugin

cubabit
I think 'Plugin::SmartURI' also works, but your suggestion is clearer. Not an answer to my question, but I'll use it anyway. Thanks :)
warpr
Sorry - I misread the question. That'll teach me!
cubabit
+1  A: 

Answering my own question here, as I discovered the answer through other means.

To load the plugin, it needs to be passed to 'use Catalyst', or alternatively in the call to MyApp->setup ().

warpr