Apache2-HTML-Detergent

 view release on metacpan or  search on metacpan

lib/Apache2/HTML/Detergent/Config.pm  view on Meta::CPAN

package Apache2::HTML::Detergent::Config;

=head1 NAME

Apache2::HTML::Detergent::Config - Configuration for Apache2::HTML::Detergent

=head1 DESCRIPTION

This configuration module is not accessed directly.

=cut

use strict;
use warnings FATAL => 'all';

use Apache2::Const -compile => qw(OR_ALL ITERATE TAKE1 TAKE12 TAKE2);

use Apache2::CmdParms   ();
use Apache2::Module     ();
use Apache2::Directive  ();
use Apache2::ServerRec  ();
use Apache2::Log        ();
use APR::Table          ();

use Moose;
use namespace::autoclean;

use MooseX::Types::Moose qw(Maybe Str HashRef);

extends 'HTML::Detergent::Config';

# Apache stuff

BEGIN {
    my @DIRECTIVES = (
        {
            name         => 'DetergentTypes',
            req_override => Apache2::Const::OR_ALL,
            args_how     => Apache2::Const::ITERATE,
            errmsg       => 'DetergentTypes type/1 [ type/2 ...]',
            func         => '_set_type',
        },
        {
            name         => 'DetergentXSLT',
            req_override => Apache2::Const::OR_ALL,
            args_how     => Apache2::Const::TAKE1,
            errmsg       => 'DetergentXSLT /path/to.xsl',
            func         => '_set_xslt',
        },
        {
            name         => 'DetergentMatch',
            req_override => Apache2::Const::OR_ALL,
            args_how     => Apache2::Const::TAKE12,
            errmsg       => 'DetergentMatch /xpath [ /uri/path/of.xsl ]',
            func         => '_add_match',
        },
        {
            name         => 'DetergentLink',
            req_override => Apache2::Const::OR_ALL,
            args_how     => Apache2::Const::TAKE2,
            errmsg       => 'DetergentLink rel href',
            func         => '_add_link',
        },
        {
            name         => 'DetergentMeta',
            req_override => Apache2::Const::OR_ALL,
            args_how     => Apache2::Const::TAKE2,
            errmsg       => 'DetergentMeta name content',
            func         => '_add_meta',
        },
    );

    # XXX there might be a more 'correct' way to trigger this
    if ($ENV{MOD_PERL}) {
        Apache2::Module::add(__PACKAGE__, \@DIRECTIVES);
    }
}

# GRRR

sub _set_type {
    my ($self, undef, @rest) = @_;
    $self->set_type(@rest);
}

sub _set_xslt {



( run in 1.720 second using v1.01-cache-2.11-cpan-39bf76dae61 )