I'm working with Chapter 8 of the Eagle book to make an automatic
installer for my new module.

This isn't quite the easiest thing in the book.

I have a module that will need 3 parameters set via .htaccess
file:

$DEBUG = 0 or 1 (off or on)
$time_limit = number of seconds before a user is timed out
$max_limit = default maximum inactive time before timeout.

To set them in the .htaccess file, I think I want to use
something like the following:

PerlSetVar TimeOut 'debug => 1, TIME_LIMIT => 900, MAX_LIMIT =>
900'

I think I will need something like this in my main module file:

sub TimeOut ($$$$) {
        my ($cfg, $parms, $option, $setting) = @_;
        $cfg->{TimeOut}{$option} = $setting;
        }

And to use these, I will need to do something like:

my %mappings = ();
if(my $cfg = Apache::ModuleConfig->get($r)) {
        %mappings = %{ $cfg->{TimeOut} } if $cfg->{TimeOut};
}

And call them like so:

my $DEBUG = $mappings{'debug'};
my $time_limit = $mappings{'TIME_LIMIT'};
my $max_limit = $mappings{'MAX_LIMIT'};

And in the main configuration file, call:

PerlModule Apache::TimeOut

In my Makefile.PL, I think I should do this:

my @directives = (
                        { name  => 'TimeOut',
                          errmsg => 'an option (debug, TIME_LIMIT, MAX_LIMIT) and
value',
                          args_how => 'TAKE2',
                          reg_override => 'OR_AUTHCFG'
                        }
                 );

I know I've done a lot of talking, but can someone tell me if
I've messed something up?

Thanks,
JJ      

-- 
J. J. Horner
[EMAIL PROTECTED] http://www.knoxlug.org
System has been up: 2 days.

Reply via email to