[Catalyst] Stand-alone Scripts

Eden Cardim edencardim at gmail.com
Sat Apr 28 03:05:19 GMT 2012


>>>>> "Glen" == Glen Diener <gdiener at excelii.com> writes:

    Glen> Within the Catalyst application I able to use the following
    Glen> successfully:

    Glen> my $demo = $c->model('DemoDB::ddddemo')->find($demoid);

You should be able to do:

use MyApp;
my $demo = MyApp->model('DemoDB::dddemo')->find($demoid);

If you're concerned about the load time of the other components in your app,
you should be able to add a myapp.pl config containing

{
  setup_components => { only => qr/Model::DemoDB/ }
}

This will load only your schema, with the correct configs. (With a bit of
->setup munging you'll be able to eliminate plugins as well)

Or, you can use the "cleaner" route and use a standalone Config::JFDI setup
and decouple everything from the app, which I find to be more troublesome to
maintain.

-- 
      Eden Cardim         Need help with your Catalyst or DBIx::Class project?
      Code Monkey                 http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.    Want a managed development or deployment platform?
 http://edencardim.com            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list