| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Text::Clevery::Context; |
|
2
|
14
|
|
|
14
|
|
13844
|
use Any::Moose; |
|
|
14
|
|
|
|
|
604964
|
|
|
|
14
|
|
|
|
|
129
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has _engine => ( |
|
5
|
|
|
|
|
|
|
is => 'ro', |
|
6
|
|
|
|
|
|
|
isa => 'Object', |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
weak_ref => 1, |
|
9
|
|
|
|
|
|
|
); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has env => ( |
|
12
|
|
|
|
|
|
|
is => 'ro', |
|
13
|
|
|
|
|
|
|
isa => 'HashRef', |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
default => sub { \%ENV }, |
|
16
|
|
|
|
|
|
|
); |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has request => ( |
|
19
|
|
|
|
|
|
|
is => 'ro', |
|
20
|
|
|
|
|
|
|
isa => 'Object', |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
lazy => 1, |
|
23
|
|
|
|
|
|
|
default => sub { |
|
24
|
|
|
|
|
|
|
my($self) = @_; |
|
25
|
|
|
|
|
|
|
require Plack::Request; |
|
26
|
|
|
|
|
|
|
return Plack::Request->new( $self->env ); |
|
27
|
|
|
|
|
|
|
}, |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
handles => { |
|
30
|
|
|
|
|
|
|
cookies => 'cookies', |
|
31
|
|
|
|
|
|
|
}, |
|
32
|
|
|
|
|
|
|
); |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has get => ( |
|
35
|
|
|
|
|
|
|
is => 'ro', |
|
36
|
|
|
|
|
|
|
isa => 'HashRef', |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
lazy => 1, |
|
39
|
|
|
|
|
|
|
default => sub { |
|
40
|
|
|
|
|
|
|
my($self) = @_; |
|
41
|
|
|
|
|
|
|
return $self->request->query_parameters->as_hashref(); |
|
42
|
|
|
|
|
|
|
}, |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has post => ( |
|
46
|
|
|
|
|
|
|
is => 'ro', |
|
47
|
|
|
|
|
|
|
isa => 'HashRef', |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
lazy => 1, |
|
50
|
|
|
|
|
|
|
default => sub { |
|
51
|
|
|
|
|
|
|
my($self) = @_; |
|
52
|
|
|
|
|
|
|
return $self->request->body_parameters->as_hashref(); |
|
53
|
|
|
|
|
|
|
}, |
|
54
|
|
|
|
|
|
|
); |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
has session => ( |
|
57
|
|
|
|
|
|
|
is => 'ro', |
|
58
|
|
|
|
|
|
|
isa => 'HashRef', |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
lazy => 1, |
|
61
|
|
|
|
|
|
|
default => \&_build_hashref, |
|
62
|
|
|
|
|
|
|
); |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
has const => ( |
|
65
|
|
|
|
|
|
|
is => 'ro', |
|
66
|
|
|
|
|
|
|
isa => 'HashRef', |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
lazy => 1, |
|
69
|
|
|
|
|
|
|
default => \&_build_hashref, |
|
70
|
|
|
|
|
|
|
); |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
has capture => ( |
|
73
|
|
|
|
|
|
|
is => 'ro', |
|
74
|
|
|
|
|
|
|
isa => 'HashRef', |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
lazy => 1, |
|
77
|
|
|
|
|
|
|
default => \&_build_hashref, |
|
78
|
|
|
|
|
|
|
); |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
has section => ( |
|
81
|
|
|
|
|
|
|
is => 'ro', |
|
82
|
|
|
|
|
|
|
isa => 'HashRef', |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
lazy => 1, |
|
85
|
|
|
|
|
|
|
default => \&_build_hashref, |
|
86
|
|
|
|
|
|
|
); |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
has foreach => ( |
|
89
|
|
|
|
|
|
|
is => 'ro', |
|
90
|
|
|
|
|
|
|
isa => 'HashRef', |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
lazy => 1, |
|
93
|
|
|
|
|
|
|
default => \&_build_hashref, |
|
94
|
|
|
|
|
|
|
); |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
has _storage => ( # per-request storage |
|
97
|
|
|
|
|
|
|
is => 'ro', |
|
98
|
|
|
|
|
|
|
isa => 'HashRef', |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
lazy => 1, |
|
101
|
|
|
|
|
|
|
default => \&_build_hashref, |
|
102
|
|
|
|
|
|
|
); |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub config { |
|
105
|
13
|
|
|
13
|
1
|
22
|
my($self) = @_; |
|
106
|
|
|
|
|
|
|
|
|
107
|
13
|
|
|
|
|
66
|
my $file = $self->_engine->current_file(); |
|
108
|
13
|
|
50
|
|
|
52
|
my $config = $self->_storage->{config} ||= {}; |
|
109
|
13
|
|
66
|
|
|
155
|
return $config->{$file} ||= do { |
|
110
|
6
|
|
|
|
|
38
|
require Storable; |
|
111
|
6
|
|
50
|
|
|
19
|
my $proto = $config->{'@global'} ||= {}; |
|
112
|
6
|
|
|
|
|
367
|
Storable::dclone($proto); |
|
113
|
|
|
|
|
|
|
}; |
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub template { |
|
117
|
1
|
|
|
1
|
1
|
3
|
my($self) = @_; |
|
118
|
1
|
|
|
|
|
14
|
return $self->_engine->current_file(); |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub ldelim { |
|
122
|
2
|
|
|
2
|
1
|
7
|
my($self) = @_; |
|
123
|
2
|
|
|
|
|
16
|
return $self->_engine->{tag_start}; |
|
124
|
|
|
|
|
|
|
} |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub rdelim { |
|
127
|
2
|
|
|
2
|
1
|
4
|
my($self) = @_; |
|
128
|
2
|
|
|
|
|
25
|
return $self->_engine->{tag_end}; |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
2
|
|
|
2
|
1
|
158
|
sub server { shift()->env } |
|
132
|
|
|
|
|
|
|
|
|
133
|
1
|
|
|
1
|
1
|
6
|
sub version { Text::Clevery->smarty_compatible_version } |
|
134
|
|
|
|
|
|
|
|
|
135
|
1
|
|
|
1
|
1
|
10
|
sub now { time } |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub _build_hashref { |
|
138
|
13
|
|
|
13
|
|
92
|
return {}; |
|
139
|
|
|
|
|
|
|
} |
|
140
|
14
|
|
|
14
|
|
17653
|
no Any::Moose; |
|
|
14
|
|
|
|
|
33
|
|
|
|
14
|
|
|
|
|
71
|
|
|
141
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
|
142
|
|
|
|
|
|
|
__END__ |