Jifty::Config -- wrap a jifty configuration file
This class method instantiates a new
Jifty::Config object. This object deals with configuration files.
PARAMHASH currently takes a single option
This boolean defaults to true. If true, "load" will be called upon initialization.
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 configuration 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.
After loading the site configuration file (if it exists), the framework will look for a test configuration file, specified in either the framework's
TestConfig or the
JIFTY_TEST_CONFIG environment variable.
Values in the test configuration will clobber the site configuration. 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.)
Get the framework configuration variable
Get the application configuration variable
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.
We have a couple default values that shouldn't be included in the "guessed" config, as that routine is used when initializing a new application. Generally, these are platform-specific file locations.
Loads a YAML configuration file and returns a hashref to that file's data.
Various folks at BestPractical Solutions, LLC.