[Catalyst] Additional scripts accessing the Model and Config?
catalyst at mikeraynham.co.uk
Sun Jun 10 15:18:22 GMT 2012
On 08/06/12 19:05, Luis Muñoz wrote:
> But still, I would like to have access to the configuration data (for instance, how to setup the database/ldap/whatever Model, etc). Does that happen as well when using the class method?
As W. Tyler Gee stated, you appear to have fallen into the trap of
assuming that Catalyst owns your application configuration, and that you
therefore have to access it via the Catalyst context object. Catalyst
makes it easy to access the application configuration from within
Catalyst, which is perhaps why this trap can sneak up on you.
Dave Rolsky wrote an interesting blog article about how he uses
Catalyst, and in it, he talks about the use of configuration data:
The R2 project to which he refers is available on GitHub:
If you look at lib/R2.pm, you'll see that it pulls configuration data in
from R2::Config - an application config module. I found looking through
the R2 code very informative.
More information about the Catalyst