line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FirePHP::LogConnector; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
FirePHP::LogConnector |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
B<FirePHP::LogConnector> is an abstract base class for |
12
|
|
|
|
|
|
|
FirePHP log connectors. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
1054
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
17
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
5
|
use base qw/Class::Accessor::Fast/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
94
|
|
20
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw/enabled fire_php/ ); |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
66
|
|
23
|
1
|
|
|
1
|
|
7
|
use Scalar::Util qw/blessed/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
205
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 METHODS |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 $class->new |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Returns a new abstract log connector |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
35
|
0
|
|
|
|
|
|
my %opts; |
36
|
0
|
0
|
|
|
|
|
%opts = %{ $_[0] } if ref $_[0] eq 'HASH'; |
|
0
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
$opts{enabled} = 0 unless exists $opts{enabled}; |
38
|
0
|
0
|
|
|
|
|
$opts{fire_php} = 0 unless exists $opts{fire_php}; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return $class->SUPER::new( \%opts ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 $self->prepare_grouping |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Subclasses that need to prepare the opening or closing |
46
|
|
|
|
|
|
|
of a group (e.g. flushing the logs) should implement it here. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
0
|
1
|
|
sub prepare_grouping {} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 $self->dispatch_request( $coderef, @args ) |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Handler for controlling the dispatch cycle and binding L<FirePHP::Dispatcher> |
55
|
|
|
|
|
|
|
to the current response headers. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
0
|
1
|
|
sub dispatch_request { croak 'Method needs to be defined in a subclass' } |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head2 $self->flush_log |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Method to write all pending FirePHP messages (not necessarily all |
64
|
|
|
|
|
|
|
log messages) to the response headers. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
0
|
1
|
|
sub flush_log { croak 'Method needs to be defined in a subclass' } |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 $self->fetch_dispatcher |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Returns the current L<FirePHP::Dispatcher> object. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub fetch_dispatcher { |
77
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
78
|
0
|
|
|
|
|
|
return $self->{fire_php}; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 SEE ALSO |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L<http://www.firephp.org>, L<FirePHP::Dispatcher> |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 AUTHOR |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Sebastian Willert, C<willert@cpan.org> |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Copyright 2009 by Sebastian Willert E<lt>willert@cpan.orgE<gt> |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
98
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |