line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
137
|
use 5.010001; |
|
5
|
|
|
|
|
22
|
|
2
|
5
|
|
|
5
|
|
40
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
130
|
|
3
|
5
|
|
|
5
|
|
31
|
use warnings; |
|
5
|
|
|
|
|
19
|
|
|
5
|
|
|
|
|
324
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Story::Interact::PageSource::DBI; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.001013'; |
9
|
|
|
|
|
|
|
|
10
|
5
|
|
|
5
|
|
33
|
use Moo; |
|
5
|
|
|
|
|
25
|
|
|
5
|
|
|
|
|
43
|
|
11
|
5
|
|
|
5
|
|
2273
|
use Types::Common -types; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
44
|
|
12
|
5
|
|
|
5
|
|
72640
|
use Types::Path::Tiny -types; |
|
5
|
|
|
|
|
231359
|
|
|
5
|
|
|
|
|
67
|
|
13
|
5
|
|
|
5
|
|
8149
|
use namespace::clean; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
64
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
with 'Story::Interact::PageSource'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has 'dbh' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
isa => Object, |
20
|
|
|
|
|
|
|
required => 1, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has 'sth' => ( |
24
|
|
|
|
|
|
|
is => 'lazy', |
25
|
|
|
|
|
|
|
isa => Object, |
26
|
2
|
|
|
2
|
|
24
|
builder => sub { my $s = shift; $s->dbh->prepare( $s->sql ) }, |
|
2
|
|
|
|
|
37
|
|
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has 'sql' => ( |
30
|
|
|
|
|
|
|
is => 'lazy', |
31
|
|
|
|
|
|
|
isa => Str, |
32
|
2
|
|
|
2
|
|
49
|
builder => sub { 'SELECT content FROM page WHERE id=?' } |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub _build_sth { |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return ; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub get_source_code { |
41
|
14
|
|
|
14
|
0
|
30
|
my ( $self, $page_id ) = @_; |
42
|
14
|
|
|
|
|
246
|
my $sth = $self->sth; |
43
|
14
|
|
|
|
|
1693
|
$sth->execute( $page_id ); |
44
|
14
|
100
|
|
|
|
264
|
if ( my ( $content ) = $sth->fetchrow_array ) { |
45
|
12
|
|
|
|
|
66
|
return $content; |
46
|
|
|
|
|
|
|
} |
47
|
2
|
|
|
|
|
62
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub all_page_ids { |
51
|
0
|
|
|
0
|
0
|
|
my ( $self ) = @_; |
52
|
0
|
|
|
|
|
|
map $_->[0], @{ $self->dbh->selectall_arrayref('SELECT id FROM page') }; |
|
0
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |