CGI-MxScreen
view release on metacpan or search on metacpan
MxScreen/Config.pm view on Meta::CPAN
#
# Set configuration defaults.
#
sub set_defaults {
DFEATURE my $f_;
{
package CGI::MxScreen::cf;
no strict 'vars';
$fatals_to_browser = 1;
$disable_upload = 1;
$view_source = 1;
$mx_check_vars = 1;
$mx_buffer_stdout = 1;
}
return DVOID;
}
#
# is_configured
#
MxScreen/Config.pm view on Meta::CPAN
#
Carp::Datum->import($CGI::MxScreen::cf::datum_on ? "on" : "off");
if (defined $CGI::MxScreen::cf::datum_config) {
my $datum_config = $CGI::MxScreen::cf::datum_config;
$datum_config = "$Bin/$datum_config" unless $datum_config =~ m|^/|;
DLOAD_CONFIG(-file => $datum_config) if -f $datum_config;
}
#
# "disable_upload" and "post_max"
#
$CGI::DISABLE_UPLOADS = 1
if $CGI::MxScreen::cf::disable_upload;
$CGI::POST_MAX = $CGI::MxScreen::cf::post_max || 1024 * 1024;
#
# "fatals_to_browser" and "fatal_message"
#
if ($CGI::MxScreen::cf::fatals_to_browser) {
require CGI::Carp;
CGI::Carp->import('fatalsToBrowser');
CGI::Carp::set_message($CGI::MxScreen::cf::fatal_message)
MxScreen/Config.pm view on Meta::CPAN
CGI::MxScreen::Config - configuration for CGI::MxScreen
=head1 SYNOPSIS
use CGI::MxScreen::Config "./filename.pl";
use CGI::MxScreen::Config ({ -FILE => "./filename.pl" });
use CGI::MxScreen::Config ({
-FILE => "./filename.pl", # Common init
-disable_upload => 0, # Supersede common init
-fatals_to_browser => 0,
-loglevel => "debug",
});
=head1 DESCRIPTION
The CGI::MxScreen::Config module is meant to provide compile-time
configuration for the CGI::MxScreen framework.
Configuration parameters may be set in a Perl file (which is loaded via
MxScreen/Config.pm view on Meta::CPAN
When set to a non-null string, refers to the configuration file to
load for C<Carp::Datum> dynamic configuration. See L<Carp::Datum::Cfg> for
details.
=item datum_on
When true, activates C<Carp::Datum>. Note that the C<datum_config> variable
is used to load the configuration even when this variable is set to false.
=item disable_upload
Sets C<$CGI::DISABLE_UPLOADS> to true if set.
=item fatal_message
The fatal message to be used by C<CGI::Carp> when C<fatals_to_browser> is set.
See L<CGI::Carp> for details.
=item fatals_to_browser
MxScreen/Config.pm view on Meta::CPAN
By default, the $\ variable is set to "\n" so that all print statements
end-up being on their own line. This tends to produce view-able source code.
Setting this to 0 avoids touching $\. You may of course add your own "\n"
to each print statement, but this is not recommended.
=head1 EXAMPLE
Here is a configuration file example:
$disable_upload = 1;
$post_max = 10 * 1024;
$fatals_to_browser = 1;
$datum_config = "debug.cf";
$datum_on = 1;
$logdir = "/home/ram/public_html/log";
$logfile = "%s.log";
$logstamp = "own";
t/cgi/mx-config.pl view on Meta::CPAN
# $Log: mx-config.pl,v $
# Revision 0.1 2001/04/22 17:57:05 ram
# Baseline for first Alpha release.
#
# $EndLog$
#
$libpath = "$bindir";
$fatals_to_browser = 1;
$disable_upload = 1;
$post_max = 512 * 1024; # 512 kb
$datum_config = "debug.cf";
$datum_on = 0;
$logdir = "$bindir/../logs";
$logfile = "mx.err"; # For CGI::Carp, since we also define $logchannels
#
# loglevel
( run in 2.065 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )