NAME

Apache2::Controller::Methods - methods shared by Apache2::Controller modules

SYNOPSIS

package Apache2::Controller::SomeNewBrilliantPlugin;

use base qw( Apache2::Controller::Methods );

# ...
my $directives = $self->get_directives();
my $directive  = $self->get_directive('A2CSomethingSomething');

DESCRIPTION

Methods shared in common by various Apache2::Controller modules, like Apache2::Controller, Apache2::Controller::Dispatch, etc.

Note: In this module we always dereference $self-{r}>, because we don't know if $self is blessed as an Apache2::Request yet or not. (This package is used as a base by multiple handler stages.)

METHODS

get_directives

my $directives_hashref = $self->get_directives();

Returns the Apache2::Controller::Directives config hash for this request, with per-directory settings.

NOTE: real directives don't work because of problems with Apache::Test. For now use PerlSetVar.

When directives work, if you mix A2C Directives with PerlSetVar statements in Apache config, the directives take precedence and the PerlSetVar values are not merged. Hrmm. Well, I think there's a method, but I've got better things to work on right now.

get_directive

my $value = $self->get_directive( $A2CDirectiveNameString )

Returns the value of the given directive name. Does not die if get_directives() returns an empty hash.

NOTE: directives don't work because of problems with Apache::Test. For now use PerlSetVar.

get_apache2_request_opts

my %opts = $self->get_apache2_request_opts( $controller_class_name );

Returns the Apache2::Request options hash (i.e. POST_MAX and TEMP_DIR, etc.) for a given Apache2::Controller controller module class name. Caches this information for speedup.

my $jar = $self->get_cookie_jar();

Fetches cookies with Apache2::Cookie::Jar. Caches them in <$self-pnotes->{cookie_jar}>> for the duration of the request. Further calls to get_cookie_jar() from any handler will return the same jar without re-parsing them.

probably not....

If <$self> is not an Apache2::Request, the request object will be created temporarily to pass to Apache2::Cookie::Jar. The man page for Apache2::Request says that in version 2.2 of Apache, at any rate, this is always the same object during the lifecycle of a request. But we use the 'instance' method here if necessary to create it. Your mileage may vary.

because the only thing passed on is the pool from the obj, and Jar's delegate says it takes a RequestRec

SEE ALSO

Apache2::Controller

Apache2::Controller::Session

Apache2::Request

Apache2::Module

Apache2::Directives

Apache2::Cookie

AUTHOR

Mark Hedges, hedges +(a t)- scriptdolphin.org

COPYRIGHT AND LICENSE

Copyright 2008 Mark Hedges. CPAN: markle

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.