Understanding the config file
Every Jifty Application uses a config file, etc/config.yml to control its operation. In absence of a config file, all values are guessed with reasonable defaults. The config file is in yaml format, which is described on the YAML Homepage.
A sample config file
A typical minimal config file looks like this:
---
framework:
AdminMode: 1
ApplicationClass: DemoApp
ApplicationName: DemoApp
Database:
Database: demoapp
Driver: SQLite
Host: localhost
Password: ''
RecordBaseClass: Jifty::DBI::Record::Cachable
User: ''
Version: 0.0.1
DevelMode: 1
L10N:
PoDir: share/po
LogLevel: INFO
Mailer: Sendmail
MailerArgs: []
Plugins:
- Login: {}
Web:
BaseURL: http://localhost
DataDir: var/mason
Globals: []
MasonConfig:
autoflush: 0
default_escape_flags: h
error_format: text
error_mode: fatal
Port: 8888
ServeStaticFiles: 1
StaticRoot: share/web/static
TemplateRoot: share/web/templates
Accessing config entries
Note that the top level key in this config file is framework. Inside Jifty, you might access any point under this key by simply using Jifty->config->framework->('some_key')->{whatever}.
If you like to define some structure of your own, Jifty reserves the top level keyword application whose entries can get accessed by using Jifty->config->app->('some_key')->{whatever}.
If you intend to edit the config file by hand, be sure that you understand the basics of the YAML format. Please do not change the indentation of lines and ensure your editor will not replace series of spaces by tab characters.
Understanding the entries
The most interesting keys are:
framework/AdminMode
If this switch is set to '1' (or a value that renders to a boolean "true" value to be precise), the administration mode is enabled in the frontend. The default templates will add a red bar displaying a hint and add some administrative entries into the page navigation bar. Internally, the user currently browsing through the application will by default be a superuser if not logged in.
framework/ApplicationClass
This is the class name that builds the top level of all application classes. All model and action classes will get searched in this namespace.
framework/ApplicationName
The name of the application will be displayed in some templates eg. as a title or in greeting messages after successful signup.
framework/Database
Here, the database to get used is specified. The keys under this one control the vendor as well as the credentials and the dsn to access the database.
framework/DevelMode
If this switch holds '1' (or another true value) the application will be optimized for developing. This includes refreshing of modules, as well as accessing all JavaScript and CSS files as single requests. If devel-mode is switched off, no module refreshing will be done and the whole JavaScript and all CSS definitions will get accessed by one request each.
framework/L10N
controls the locations where localization files can be found.
framework/LogLevel
defines the verbosity of logging.
framework/Mailer
framework/MailerArgs
specifies the mailer to get used when a notification will get sent out by
Jifty::Notification.framework/Plugins
holds an array of plugins to get loaded during application startup.
framework/Web
framework/Web/BaseURL
framework/Web/DataDir
framework/Web/FastCGI
framework/Web/Globals
framework/Web/MasonConfig
framework/Web/Port
framework/Web/ServeStaticFiles
framework/Web/StaticRoot
framework/Web/TemplateRoot