File: AddDispatchTypes.pm

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 673 bytes parent folder | download | duplicates (12)
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
package TestApp::Plugin::AddDispatchTypes;
use strict;
use warnings;
use MRO::Compat;

sub setup_dispatcher {
    my $class = shift;

    ### Load custom DispatchTypes, as done by Catalyst::Plugin::Server
    # There should be a waaay less ugly method for doing this,
    # FIXME in 5.9
    $class->next::method( @_ );
    $class->dispatcher->preload_dispatch_types(
        @{$class->dispatcher->preload_dispatch_types},
        qw/ +TestApp::DispatchType::CustomPreLoad /
    );
    $class->dispatcher->postload_dispatch_types(
        @{$class->dispatcher->postload_dispatch_types},
        qw/ +TestApp::DispatchType::CustomPostLoad /
    );

    return $class;
}

1;