The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Konstrukt::Settings - Settings management

SYNOPSIS

        #there is one registy object that may be used from everywhere in the konstrukt-code
        #set a default value. very useful in the init() method of your plugin
        $Konstrukt::Settings->default('yourplugin/key' => 'defaultvalue');
        #set a value
        $Konstrukt::Settings->set('yourplugin/key' => 'value');
        #get a value
        my $value = $Konstrukt::Settings->get('key');

DESCRIPTION

This is the place where all settings are stored. The initial settings will be loaded from your konstrukt.settings, which is placed in the document root of each site.

Note that the settings are not persistent between multiple requests! They will be (re)loaded on each request. For persistance take a look at Konstrukt::Session.

For further information take a look at the documentation for each method.

CONFIGURATION

All initial settings are stored in your konstrukt.settings, which is placed in the document root of each site.

Each directive looks like this:

        some/plugins/setting   here go the values #this comment will be ignored

Take a look at the documentation of each module/plugin. If it offers settings, they will be described at the CONFIGURATION section of each module/plugin.

METHODS

new

Constructor of this class

init

Initialization of this class

load_settings

Loads the settings from the specified file

Parameters:

  • $file - The path (relative to the document root) to the settings file.

get

Returns a value from the konstrukt settings.

Parameters:

  • $key - The settings key

set

Works similary to get() but accepts two parameters and lets you set values instead of reading them.

Parameters:

  • $key - The name of the entry

  • $value - The value you want to set

default

Only sets a value if it's not been set, yet. Useful for specifying default settins.

Parameters:

  • $key - The name of the entry

  • $value - The value you want to set

delete

Works similary to get() and set() but instead of reading or writing from or to an entry you simply clear a value of a specific entry.

Parameters:

  • $key - The entry to delete

AUTHOR

Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.

This document is free software. It is distributed under the same terms as Perl itself.

SEE ALSO

Konstrukt