
PSA::Config - Site configuration

# load the config file - don't process anything my $config = PSA::Config->new; # setup Perl and auto-detect administration options $config->engage;

PSA::Config provides access to the application level configuration. Currently, this is achieved via the YAML module.

Loads the config file. The default location is etc/psa.yml, but this can be over-ridden by passing in a location.
This is basically a thin wrapper for "Load" in YAML. Note that this is not a singleton method.
This method does all the auto-configuration normally needed for most startups. This is divided between ->autoconf() and ->perlconf() methods, in order, as described below:
The purpose of autoconf() is to automatically determine, from the configuration file and current working directory, what extra configurtion options should be set.
This is discussed in terms of the current site phase. Normally, projects will use between two and four phases of development for each cycle, such as development, snapshot, preview, testing, and production. The number of phases, etc are all of course quite arbirary This is configured by defining a map;
phase_rules: ? '.*prd:.*/prod' : prod ? '.*prd:.*/test' : test ? '.*tst:.*/prev' : snap ? '.*:.*/dev' : dev
Keys in the map are strings to match against the hostname:PSA root pair. Then, all you do is add extra config data in the phases key;
phases:
prod:
acceptor: { nproc: 5, socket: ':6000' }
test:
acceptor: { nproc: 2, socket: 6001 }
snap:
acceptor: { nproc: 2, socket: 'var/appSocket' }
dev:
acceptor: { nproc: 1, socket: 'var/appSocket' }
The entire structure under each phase is copied into the root config hash. So, if the above configuration settings were made, and the application started via the psa wrapper in /abc/apps/prev on the host blahtst, then the snap phase would be automatically selected. So, it would be equivalent to setting:
acceptor: nproc: 2 socket: 'var/appSocket'
(note; alternate YAML styles are showed above for brevity)
This is a general purpose method which looks for some standard options designed to configure Perl in some way, such as setting include paths.
For secure invocations of psa, this is always called after PSA::Auth (responsible for dropping privileges) has been loaded.
