[Catalyst] rewrite or reload on YAML

Roland Lammel rl at brabbel.net
Fri Dec 22 21:52:36 GMT 2006


I second that.

Always keep static configuration (e.g. basic settings to get the app going,
which are usually configured once) and volatile / temporary / user related
configuration seperated.
Unless you are storing  your data in files instead of a database, I'd use a
dedicated database table for configuration.

A basic table could be something like (contraints and autoincrements
omited):
CREATE TABLE configuration (id INTEGER, user VARCHAR(12), param VARCHAR(30),
value VARCHAR(255));

(You can use the same table for system configuration as special user
"system" if you'd like to keep the schema small)

+rl

On 12/22/06, Brandon Black <blblack at gmail.com> wrote:
>
> On 12/22/06, Wan <wanmyome at gmail.com> wrote:
> > I will run myapp on mod_perl or FastCGI, but I want to know how to
> > rewrite or reload my YAML file.
> >
> > for example
> >
> > # myapp has this line
> > $c->config->{SomeKey} =3D 'SomeValue';
> >
> > .....
> >
> > How can save this value to my YAML file, and how can I reload this
> value.
> > I don't want restart my web server. Before Catalyst I usually save the
> > values
> > to a file and reload the values myself.
> >
> > I'm a beginner of YAML and Catalyst.
> >
>
> Probably the best way to handle volatile configuration data would be
> to put those values in a database rather than in your yaml config, and
> use them via your database model.
>
> -- Brandon
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>



-- =

Roland Lammel

"Enjoy your job, make lots of money, work within the law. Choose any two."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20061222/55693=
855/attachment.htm


More information about the Catalyst mailing list