NAME
Jifty::Config -- wrap a jifty configuration file
DESCRIPTION
METHODS
new PARAMHASH
This class method instantiates a new Jifty::Config
object. This object deals with configuration files.
PARAMHASH currently takes a single option
- load_config
-
This boolean defaults to true. If true, "load" will be called upon initialization.
load
Jifty first loads the main configuration file for the application, looking for the JIFTY_CONFIG
environment variable or etc/config.yml
under the application's base directory.
It uses the main contifuration file to find a vendor configuration file -- if it doesn't find a framework variable named 'VendorConfig', it will use the JIFTY_VENDOR_CONFIG
environment variable.
After loading the vendor configuration file (if it exists), the framework will look for a site configuration file, specified in either the framework's SiteConfig
or the JIFTY_SITE_CONFIG
environment variable.
Values in the site configuration file clobber those in the vendor configuration file. Values in the vendor configuration file clobber those in the application configuration file.
Once we're all done loading from files, several defaults are assumed based on the name of the application -- see "guess".
After we have the config file, we call the coderef in $Jifty::Config::postload
, if it exists.
If the value begins and ends with %, converts it with Jifty::Util/absolute_path
to an absolute path. (This is unnecessary for most configuration variables which specify files, but is needed for variables such as MailerArgs
that only sometimes specify files.)
framework VARIABLE
Get the framework configuration variable VARIABLE
.
app VARIABLE
Get the application configuration variable VARIABLE
.
guess
Attempts to guess (and return) a configuration hash based solely on what we already know. (Often, in the complete absence of a configuration file). It uses the name of the directory containing the Jifty binary as a default for ApplicationName
if it can't find one.
load_file PATH
Loads a YAML configuration file and returns a hashref to that file's data.
AUTHOR
Various folks at BestPractical Solutions, LLC.