File: extra.conf.in

package info (click to toggle)
libmasonx-interp-withcallbacks-perl 1.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 228 kB
  • sloc: perl: 1,784; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 1,826 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<IfModule mod_perl.c>
  PerlSetVar MasonCompRoot @DocumentRoot@
  <IfDefine !MODPERL2>
    <Perl>
      use File::Spec::Functions qw(catdir);
      use lib catdir '@ServerRoot@', 'lib';
      use lib catdir '@ServerRoot@', '..', 'blib';
      use lib catdir '@ServerRoot@', '..', 'lib';
    </Perl>
  </IfDefine>
  PerlModule TestCallbacks
  SetHandler perl-script
  PerlHandler TestCallbacks
  <Location /ooconf>
    SetHandler perl-script
    PerlSetVar MasonCbClasses _ALL_
    PerlSetVar MasonInterpClass MasonX::Interp::WithCallbacks
    PerlHandler HTML::Mason::ApacheHandler
  </Location>
  <Location /conf>
    SetHandler perl-script
    PerlSetVar MasonDefaultPriority 3
    PerlSetVar MasonDefaultPkgKey CBFoo
    PerlSetVar MasonCbExceptionHandler "sub {}"
    PerlAddVar MasonCallbacks "{ cb_key  => 'priority', cb => sub { $_[0]->params->{result} = $_[0]->priority } }"
    PerlAddVar MasonCallbacks "{ cb_key  => 'pkg_key', cb => sub { $_[0]->params->{result} = $_[0]->pkg_key } }"
    PerlAddVar MasonCallbacks "{ cb_key  => 'die', cb => sub { die 'Ow!' } }"
    PerlAddVar MasonPreCallbacks "sub { my $params = $_[0]->params; $params->{result} = uc $params->{result} if $params->{do_upper} }"
    PerlAddVar MasonPostCallbacks "sub { my $params = $_[0]->params; $params->{result} = lc $params->{result} if $params->{do_lower} }"
    PerlSetVar MasonInterpClass MasonX::Interp::WithCallbacks
    PerlHandler HTML::Mason::ApacheHandler
  </Location>
  <Location /nulls_conf>
    SetHandler perl-script
    PerlSetVar MasonDefaultPkgKey CBFoo
    PerlSetVar MasonIgnoreNulls 1
    PerlAddVar MasonCallbacks "{ cb_key  => 'exec', cb => sub { $_[0]->params->{result} = 'executed' } }"
    PerlSetVar MasonInterpClass MasonX::Interp::WithCallbacks
    PerlHandler HTML::Mason::ApacheHandler
  </Location>
</IfModule>