MPMinus
view release on metacpan or search on metacpan
lynx foo.localhost
Profit!
CONFIGURATION
Configuration parameters are initialized in the MPM::MyApp::Handlers
package, that cals via Apache web server config file.
sub handler {
my $r = shift;
my $m = MPMinus->m;
$m->conf_init($r, __PACKAGE__);
...
my $project = $m->conf('project');
...
}
For accessing to configuration variables you can use getter methods
conf or get_conf also setter method - set_conf. See
MPMinus::Configuration
APACHE PER-DIRECTORY VARIABLES
Apache per-directory variables is variables that specified by the
PerlSetVar and PerlAddVar directives in Apache config files, eg:
PerlSetVar ModperlRoot /var/www/foo.localhost
For more information about per-directory variables see
http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html
For MPMinus projects allowed following directives:
confdir
PerlSetVar confdir /var/www/foo.localhost
my $confdir = $m->conf("confdir");
This directive sets directory (path) for searching configuration
files of current project
Default: <DOCUMENT_ROOT>/conf
config, configfiles
PerlSetVar config /var/www/foo.localhost/foo.conf
my $config_file = $m->conf("fileconf");
my $config_file = $m->conf("configfiles")->[0];
In configuration file specifies configuration file. In handlers the
getter method $m->conf("configfiles") returns array of loaded
configuration files; the method $m->conf("fileconf") returns main
loaded file
Default: <DOCUMENT_ROOT>/lc(<PROJCET_NAME>).conf
debug
PerlSetVar debug on
$m->log_eror("Oops!") if $m->conf("debug");
Debug flag. The argument can be: on/off; enable/disable; yes/no;
true/false and 1/0 The $m->conf("debug") returns boolean value: 1 --
on, 0 -- off
Default: off
modperlroot
PerlSetVar modperlroot /var/www/foo.localhost
my $root = $m->conf("modperlroot");
Sets alternate of DOCUMENT_ROOT. Optional directive
Default eq <DOCUMENT_ROOT>
READ-ONLY MPMINUS PARAMETERS
Parameters that You can read only
GENERAL PARAMETERS
configloadstatus
print "Configuration has been loaded!" if $m->conf("configloadstatus");
Return boolean status of loading configuration files
Default: 0
hitime
print $m->conf("hitime"); # 1556209483.07221
Returns inited High-precision time value in seconds with 5-dig
precision
locked_keys
my $array = $m->conf("locked_keys");
Returns reference to list of locked directives (for read only)
Default:
[confdir, configloadstatus, debug, document_root, fileconf, hitime,
http_host, https, locked_keys,logdir, modperl_root, package,
prefix, project, remote_addr, remote_user, request_method,
request_uri, server_admin, server_name, server_port, sid, url]
logdir
my $dir = $m->conf("logdir");
( run in 1.798 second using v1.01-cache-2.11-cpan-39bf76dae61 )