Configuration
From CunningPlans
Upon startup, Baldrick immediately looks for its configuration file, and exits with a fatal error if this file is not present. This file governs how URLs are mapped to handlers, users are loaded, sessions are managed, and Databases are connected to, among other things. Sample configuration files can be found in the Baldrick distribution archive in the "etc/config-samples" directory.
[edit] Location of baldrick.cfg
By default, the configuration file is found as etc/baldrick.cfg (relative to the location of baldrick-stub).
These environmental variables determine where the configuration file is to be found:
- BALDRICK_WORKDIR - if defined, Baldrick will immediately chdir() to this directory. Any relative path defined in $BALDRICK_CONFIG_PATH is evaluted relative to $BALDRICK_WORKDIR.
- Default: "." (the directory where baldrick-stub is installed.)
- BALDRICK_CONFIG_PATH - The directory containing the configuration file $BALDRICK_CONFIG_FILE.
- Default: "etc"
- BALDRICK_CONFIG_FILE - the file to load, within the BALDRICK_CONFIG_PATH directory.
- Default: "baldrick.cfg".
[edit] Configuration File Overview
- See Also: Sites and Modules
The master configuration file (etc/baldrick.cfg, by default), contains settings that are shared between all of the Modules that make up a Site.
The directives in this file are mainly concerned with the common site-wide functionality such as Session management and User loading, and with mapping requests to modules.
The file is parsed with the Perl module Config::General. It resembles an Apache httpd.conf in structure: section headers in angle brackets, key=value pairs, then a close-section directive in angle brackets.
[edit] Elements of baldrick.cfg
- Baldrick section: contains a few general settings, such as site admin email.
- PathMap section: (one) maps URLs to handlers
- SessionManager section: (one or more)
