Apache2-Mogile-Dispatch

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

MANIFEST
README
LICENSE
Changes
Makefile.PL
lib/Apache2/Mogile/Dispatch.pm
t/00-compile.t
t/05-pod.t
t/06-pod_coverage.t
doc/Subclassing.pod
doc/examples/Cookie.pm
doc/examples/HTTPConfig.pm
doc/examples/Large.pm
doc/examples/SSI.pm
META.yml                                 Module YAML meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)

doc/examples/Cookie.pm  view on Meta::CPAN

package My::Cookie;

use strict;
use warnings;

use base 'Apache2::Mogile::Dispatch';

use Apache2::Cookie;
use Apache2::Cookie::Jar;

sub mogile_key {
    my ($r) = @_;
    return $r->uri;
}

sub get_direction {
    my ($r, $cf) = @_;
    my $j = Apache2::Cookie::Jar->new($r);
    my $cookie = $j->cookies('mogile');
    if (! $cookie) { return { 'mogile' => 0 }; }
    if ($cookie->value eq 'true') { return { 'mogile' => 1 }; }
    return { 'mogile' => 0 };
}

sub get_config {
    return {
        'MogTrackers' => [ 'localhost:11211', 'localhost:11212'],
        'MogStaticServers' => ['localhost:80'],

doc/examples/Cookie.pm  view on Meta::CPAN

    return 1;
}

1;
__END__

=pod

=head1 NAME

Cookie - A cookie based dispatcher

=head1 DESCRIPTION

This example module shows how to use cookies to determine if mogile is to be
used or not. It takes advantage of the apache request object being passed to
make its deciscion.

=head1 AUTHOR

Nick Gerakines, C<< <nick at socklabs.com> >>



( run in 0.353 second using v1.01-cache-2.11-cpan-e9199f4ba4c )