line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package EntityModel::Web::Apache2::RequestHandler; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
1
|
|
|
1
|
|
33
|
$EntityModel::Web::Apache2::RequestHandler::VERSION = '0.001'; |
4
|
|
|
|
|
|
|
} |
5
|
1
|
|
|
1
|
|
6
|
use EntityModel::Class { }; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
EntityModel::Web::Apache2::RequestHandler - website support for L |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
version 0.001 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 SYNOPSIS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
1069
|
use EntityModel::Web::Context; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use EntityModel::Web::Apache2::Request; |
23
|
|
|
|
|
|
|
use EntityModel::Web::Apache2::Response; |
24
|
|
|
|
|
|
|
use EntityModel::Template; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use Apache2::Const qw/OK DECLINED REDIRECT SERVER_ERROR MODE_READBYTES NOT_FOUND/; |
27
|
|
|
|
|
|
|
use Time::HiRes qw(time); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my $tmpl; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub handler { |
32
|
|
|
|
|
|
|
my $r = shift; |
33
|
|
|
|
|
|
|
my $start = time; |
34
|
|
|
|
|
|
|
my $req = EntityModel::Web::Apache2::Request->new($r); |
35
|
|
|
|
|
|
|
# $tmpl ||= EntityModel::Template->new( |
36
|
|
|
|
|
|
|
# include_path => '/home/tom/dev/EntityTestSite/template' |
37
|
|
|
|
|
|
|
# ); |
38
|
|
|
|
|
|
|
# $tmpl->process_template(\q{[% PROCESS TemplateBlocks.tt2 %]}); |
39
|
|
|
|
|
|
|
my $ctx = EntityModel::Web::Context->new( |
40
|
|
|
|
|
|
|
request => $req, |
41
|
|
|
|
|
|
|
# template => $tmpl, |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
$ctx->find_page_and_data($::WEB); |
44
|
|
|
|
|
|
|
$ctx->resolve_data; |
45
|
|
|
|
|
|
|
my $resp = EntityModel::Web::Apache2::Response->new($ctx, $r); |
46
|
|
|
|
|
|
|
my $rslt = $resp->process; |
47
|
|
|
|
|
|
|
my $elapsed = time - $start; |
48
|
|
|
|
|
|
|
logError("Page took %7.3fms", 1000.0 * $elapsed); |
49
|
|
|
|
|
|
|
return $rslt; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |