line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Component; |
2
|
101
|
|
|
101
|
|
112392
|
use strict; |
|
101
|
|
|
|
|
218
|
|
|
101
|
|
|
|
|
2934
|
|
3
|
101
|
|
|
101
|
|
458
|
use warnings; |
|
101
|
|
|
|
|
355
|
|
|
101
|
|
|
|
|
2180
|
|
4
|
101
|
|
|
101
|
|
444
|
use Carp (); |
|
101
|
|
|
|
|
182
|
|
|
101
|
|
|
|
|
1481
|
|
5
|
101
|
|
|
101
|
|
26754
|
use Plack::Util; |
|
101
|
|
|
|
|
240
|
|
|
101
|
|
|
|
|
4660
|
|
6
|
101
|
|
|
101
|
|
649
|
use overload '&{}' => \&to_app_auto, fallback => 1; |
|
101
|
|
|
|
|
271
|
|
|
101
|
|
|
|
|
1224
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
282
|
|
|
282
|
1
|
5583
|
my $proto = shift; |
10
|
282
|
|
33
|
|
|
2828
|
my $class = ref $proto || $proto; |
11
|
|
|
|
|
|
|
|
12
|
282
|
|
|
|
|
547
|
my $self; |
13
|
282
|
100
|
66
|
|
|
1961
|
if (@_ == 1 && ref $_[0] eq 'HASH') { |
14
|
207
|
|
|
|
|
462
|
$self = bless {%{$_[0]}}, $class; |
|
207
|
|
|
|
|
1146
|
|
15
|
|
|
|
|
|
|
} else { |
16
|
75
|
|
|
|
|
225
|
$self = bless {@_}, $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
282
|
|
|
|
|
1088
|
$self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub to_app_auto { |
23
|
131
|
|
|
131
|
0
|
240
|
my $self = shift; |
24
|
131
|
50
|
50
|
|
|
604
|
if (($ENV{PLACK_ENV} || '') eq 'development') { |
25
|
0
|
|
|
|
|
0
|
my $class = ref($self); |
26
|
0
|
|
|
|
|
0
|
warn "WARNING: Automatically converting $class instance to a PSGI code reference. " . |
27
|
|
|
|
|
|
|
"If you see this warning for each request, you probably need to explicitly call " . |
28
|
|
|
|
|
|
|
"to_app() i.e. $class->new(...)->to_app in your PSGI file.\n"; |
29
|
|
|
|
|
|
|
} |
30
|
131
|
|
|
|
|
327
|
$self->to_app(@_); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# NOTE: |
34
|
|
|
|
|
|
|
# this is for back-compat only, |
35
|
|
|
|
|
|
|
# future modules should use |
36
|
|
|
|
|
|
|
# Plack::Util::Accessor directly |
37
|
|
|
|
|
|
|
# or their own favorite accessor |
38
|
|
|
|
|
|
|
# generator. |
39
|
|
|
|
|
|
|
# - SL |
40
|
|
|
|
|
|
|
sub mk_accessors { |
41
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
42
|
0
|
|
0
|
|
|
0
|
Plack::Util::Accessor::mk_accessors( ref( $self ) || $self, @_ ) |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
288
|
|
|
288
|
1
|
520
|
sub prepare_app { return } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub to_app { |
48
|
343
|
|
|
343
|
1
|
1168
|
my $self = shift; |
49
|
343
|
|
|
|
|
2226
|
$self->prepare_app; |
50
|
343
|
|
|
1096
|
|
2831
|
return sub { $self->call(@_) }; |
|
1096
|
|
|
|
|
8777
|
|
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub response_cb { |
55
|
761
|
|
|
761
|
1
|
5392
|
my($self, $res, $cb) = @_; |
56
|
761
|
|
|
|
|
16288
|
Plack::Util::response_cb($res, $cb); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |