
Contentment::Setting - A Contentment plugin for storing configuration

This module is required by the Contentment core and is used to store settings and configuration information in the database.
This class adds the following methods to the context:
Returns a reference to a hash containing all the settings. Settings are permanently saved to the database when changed.
This hash can be used to store most complex types. It uses YAML to encode all the values, which can encode just about anything.
However, there are a few caveats to be careful about:
my $settings = $context->settings;
my %hash = ( foo => 1, bar => 2 );
# Works great!
$settings->{blah} = \%hash;
$hash{baz} = 3;
# Bad stuff! Outputs: foo, bar
# $settings doesn't know about baz!
print(join(', ', keys %$settings),"\n");
# Make sure you always notify the hash of deep changes:
$settings->{blah} = \%hash;

Andrew Sterling Hanenkamp, <hanenkamp@users.sourceforge.net>

Copyright 2005 Andrew Sterling Hanenkamp. All Rights Reserved.
Contentment is distributed and licensed under the same terms as Perl itself.