line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
4004928
|
use 5.16.0; |
|
1
|
|
|
|
|
4
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
93
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Dancer2::Plugin::ParamKeywords; |
6
|
1
|
|
|
1
|
|
770
|
use Dancer2::Plugin; |
|
1
|
|
|
|
|
2277
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 'v0.1.5'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
foreach my $source ( qw( route query body ) ) { |
11
|
|
|
|
|
|
|
register "$source\_param" => sub { |
12
|
3
|
|
|
3
|
|
144744
|
my ($dsl, $param) = @_; |
13
|
3
|
|
|
|
|
22
|
$dsl->app->request->params($source)->{$param}; |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
register "$source\_params" => sub { |
17
|
3
|
|
|
3
|
|
8064
|
my $dsl = shift; |
18
|
3
|
|
|
|
|
18
|
$dsl->app->request->params($source); |
19
|
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
register munged_params => sub { |
23
|
3
|
|
|
3
|
|
24590
|
my $dsl = shift; |
24
|
3
|
|
|
|
|
16
|
my $conf = plugin_setting->{munge_precedence}; |
25
|
3
|
50
|
|
|
|
258
|
die 'Please configure the plugin settings for ParamKeywords to use munged_params' |
26
|
|
|
|
|
|
|
unless ref($conf) eq 'ARRAY'; |
27
|
|
|
|
|
|
|
|
28
|
3
|
|
|
|
|
7
|
my %params = map { $dsl->app->request->params($_) } reverse @$conf; |
|
9
|
|
|
|
|
118
|
|
29
|
3
|
50
|
|
|
|
60
|
wantarray ? %params : \%params; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
register munged_param => sub { |
33
|
3
|
|
|
3
|
|
24308
|
my ($dsl, $param) = @_; |
34
|
3
|
|
|
|
|
13
|
my $conf = plugin_setting->{munge_precedence}; |
35
|
3
|
50
|
|
|
|
218
|
die 'Please configure the plugin settings for ParamKeywords to use munged_param' |
36
|
|
|
|
|
|
|
unless ref($conf) eq 'ARRAY'; |
37
|
|
|
|
|
|
|
|
38
|
3
|
|
|
|
|
7
|
my %params = map { $dsl->app->request->params($_) } reverse @$conf; |
|
9
|
|
|
|
|
118
|
|
39
|
3
|
|
|
|
|
55
|
$params{$param}; |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
register_plugin for_versions => [ 2 ] ; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ABSTRACT: Sugar for the params() keyword (DEPRECATED) |
47
|
|
|
|
|
|
|
# PODNAME: Dancer2::Plugin::ParamKeywords |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |