line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#factory response object |
2
|
|
|
|
|
|
|
package CGI::Mungo::Response; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=pod |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
CGI::Mungo::Response - Page response class |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 SYNOPSIS |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Factory class for creating response objects. |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 METHODS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
185
|
|
21
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
77
|
|
22
|
3
|
|
|
3
|
|
15
|
use Carp; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
684
|
|
23
|
|
|
|
|
|
|
######################################################### |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=pod |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 new($mungo, $plugin) |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Constructor, a factory method that will return an instance of the requested response plugin. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
If the response is not modified from the client's provided Etag header an instance of |
32
|
|
|
|
|
|
|
will be returned instead. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
######################################################### |
37
|
|
|
|
|
|
|
sub new{ |
38
|
2
|
|
|
2
|
1
|
7
|
my($class, $mungo, $plugin) = @_; |
39
|
2
|
50
|
|
|
|
9
|
if($plugin){ |
40
|
2
|
|
|
2
|
|
136
|
eval "use $plugin;"; #should do this a better way |
|
2
|
|
|
|
|
603
|
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
59
|
|
41
|
2
|
50
|
|
|
|
59
|
if(!$@){ #plugin loaded ok |
42
|
2
|
|
|
|
|
11
|
my $self = $plugin->new($mungo); |
43
|
2
|
|
|
|
|
11
|
return $self; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
else{ |
46
|
0
|
|
|
|
|
0
|
confess("Plugin load problem: $@"); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
else{ |
50
|
0
|
|
|
|
|
0
|
confess("No plugin given"); |
51
|
|
|
|
|
|
|
} |
52
|
0
|
|
|
|
|
0
|
return undef; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
######################################################### |
55
|
|
|
|
|
|
|
=pod |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 Author |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
MacGyveR |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Development questions, bug reports, and patches are welcome to the above address |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 Copyright |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Copyright (c) 2013 MacGyveR. All rights reserved. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
########################################## |
72
|
|
|
|
|
|
|
return 1; |