| 1 | package App::ZofCMS::Plugin::Debug::Dumper; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 1 | our $VERSION = '1.001010'; # VERSION | |||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use Data::Dumper; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 1 | ▶ | use HTML::Entities (qw/encode_entities/); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | |||||||||||||
| 11 | 0 | ▶ | sub new { bless {}, shift } | ||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 12 | |||||||||||||
| 13 | 0 | ▶ | sub process { | ||||||||||
|
Subroutine
process: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||
| 14 | 0 | my ( $self, $template, $query, $config ) = @_; | |||||||||||
| 15 | |||||||||||||
| 16 | my %conf = ( | ||||||||||||
| 17 | t_prefix => 'dumper_', | ||||||||||||
| 18 | use_qq => 1, | ||||||||||||
| 19 | pre => 1, | ||||||||||||
| 20 | escape_html => 1, | ||||||||||||
| 21 | line_length => 150, | ||||||||||||
| 22 | 0 | ▶ | %{ delete $config->conf->{plug_dumper} || {} }, | ||||||||||
|
Condition0%0/2
delete $config->conf->{'plug_dumper'} || {}
MC/DC0%0/1
delete $config->conf->{'plug_dumper'} || {}
delete $config->conf->{'plug_dumper'}
Truth table0%0/2
A
A= delete $config->conf->{'plug_dumper'}
| |||||||||||||
| 23 | 0 | ▶ | %{ delete $template->{plug_dumper} || {} }, | ||||||||||
|
Condition0%0/2
delete $template->{'plug_dumper'} || {}
MC/DC0%0/1
delete $template->{'plug_dumper'} || {}
delete $template->{'plug_dumper'}
Truth table0%0/2
A
A= delete $template->{'plug_dumper'}
| |||||||||||||
| 24 | ); | ||||||||||||
| 25 | |||||||||||||
| 26 | 0 | ▶ | if ( $conf{use_qq} ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 27 | 0 | $Data::Dumper::Useqq = 1; | |||||||||||
| 28 | } | ||||||||||||
| 29 | |||||||||||||
| 30 | 0 | my $t_dump = Dumper $template; | |||||||||||
| 31 | |||||||||||||
| 32 | $template->{t}{ $conf{t_prefix} . 't' . $_ } = Dumper $template->{$_} | ||||||||||||
| 33 | 0 | for qw/t d/; | |||||||||||
| 34 | |||||||||||||
| 35 | 0 | $template->{t}{ $conf{t_prefix} . 't' } = $t_dump; | |||||||||||
| 36 | 0 | $template->{t}{ $conf{t_prefix} . 'q' } = Dumper $query; | |||||||||||
| 37 | 0 | $template->{t}{ $conf{t_prefix} . 'c' } = Dumper $config->conf; | |||||||||||
| 38 | |||||||||||||
| 39 | 0 | ▶ | if ( $conf{line_length } ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 40 | 0 | for ( qw/tt td t q c/ ) { | |||||||||||
| 41 | 0 | $template->{t}{ $conf{t_prefix} . $_ } =~ s/(.{$conf{line_length}})(?!\n)/$1\n/g; | |||||||||||
| 42 | } | ||||||||||||
| 43 | } | ||||||||||||
| 44 | |||||||||||||
| 45 | 0 | ▶ | if ( $conf{escape_html} ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 46 | encode_entities $template->{t}{ $conf{t_prefix} . $_ } | ||||||||||||
| 47 | 0 | for qw/tt td t q c/; | |||||||||||
| 48 | } | ||||||||||||
| 49 | |||||||||||||
| 50 | 0 | ▶ | if ( $conf{pre} ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 51 | $template->{t}{ $conf{t_prefix} . $_ } | ||||||||||||
| 52 | = qq|<pre style="font-family: 'DejaVu Sans Mono', monotype;">| | ||||||||||||
| 53 | . $template->{t}{ $conf{t_prefix} . $_ } . q|</pre>| | ||||||||||||
| 54 | 0 | for qw/tt td t q c/; | |||||||||||
| 55 | } | ||||||||||||
| 56 | |||||||||||||
| 57 | 0 | return 1; | |||||||||||
| 58 | } | ||||||||||||
| 59 | |||||||||||||
| 60 | 1 | 1; | |||||||||||
| 61 | __END__ | ||||||||||||