line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Middleware::Debug::CatalystStash; |
2
|
1
|
|
|
1
|
|
30017
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
35
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
929
|
use parent qw(Plack::Middleware::Debug::Base); |
|
1
|
|
|
|
|
310
|
|
|
1
|
|
|
|
|
5
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
558073
|
use Catalyst; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Class::Method::Modifiers qw(install_modifier); |
10
|
|
|
|
|
|
|
use Data::Dumper; |
11
|
|
|
|
|
|
|
use HTML::Entities qw/encode_entities_numeric/; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.001002'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
install_modifier 'Catalyst', 'before', 'finalize' => sub { |
16
|
|
|
|
|
|
|
my $c = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
local $Data::Dumper::Terse = 1; |
19
|
|
|
|
|
|
|
local $Data::Dumper::Indent = 1; |
20
|
|
|
|
|
|
|
local $Data::Dumper::Deparse = 1; |
21
|
|
|
|
|
|
|
$c->req->env->{'plack.middleware.catalyst_stash'} = |
22
|
|
|
|
|
|
|
encode_entities_numeric( Dumper( $c->stash ) ); |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub run { |
26
|
|
|
|
|
|
|
my($self, $env, $panel) = @_; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
return sub { |
29
|
|
|
|
|
|
|
my $res = shift; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $stash = delete $env->{'plack.middleware.catalyst_stash'} || 'No Stash'; |
32
|
|
|
|
|
|
|
$panel->content("<pre>$stash</pre>"); |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 NAME |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Plack::Middleware::Debug::CatalystStash - Debug panel to inspect the Catalyst Stash |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 SYNOPSIS |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
builder { |
43
|
|
|
|
|
|
|
enable "Debug"; |
44
|
|
|
|
|
|
|
enable "Debug::CatalystStash"; |
45
|
|
|
|
|
|
|
sub { MyApp->run(@_) }; |
46
|
|
|
|
|
|
|
}; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 DESCRIPTION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This debug panel displays the stash content from Catalyst applications. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 AUTHOR |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Mark Ellis E<lt>markellis@cpan.orgE<gt> |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 SEE ALSO |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
L<Plack::Middleware::Debug> |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 LICENSE |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Copyright 2014 Mark Ellis E<lt>markellis@cpan.orgE<gt> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify |
65
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |