line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Labyrinth::Plugin::CPAN::Authors; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
1142339
|
use strict; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
190
|
|
4
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
132
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
21
|
use vars qw($VERSION); |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
215
|
|
7
|
|
|
|
|
|
|
$VERSION = '3.60'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Labyrinth::Plugin::CPAN::Authors - Plugin to handle Author pages. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=cut |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#---------------------------------------------------------------------------- |
16
|
|
|
|
|
|
|
# Libraries |
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
4
|
|
22
|
use base qw(Labyrinth::Plugin::Base); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
625
|
|
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
4
|
|
840163
|
use Labyrinth::Audit; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
560
|
|
21
|
4
|
|
|
4
|
|
28
|
use Labyrinth::DBUtils; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
83
|
|
22
|
4
|
|
|
4
|
|
21
|
use Labyrinth::DTUtils; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
278
|
|
23
|
4
|
|
|
4
|
|
420
|
use Labyrinth::Plugin::CPAN; |
|
4
|
|
|
|
|
11587
|
|
|
4
|
|
|
|
|
28
|
|
24
|
4
|
|
|
4
|
|
123
|
use Labyrinth::Variables; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
595
|
|
25
|
4
|
|
|
4
|
|
31
|
use Labyrinth::Writer; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
230
|
|
26
|
|
|
|
|
|
|
|
27
|
4
|
|
|
4
|
|
966
|
use JSON::XS; |
|
4
|
|
|
|
|
6438
|
|
|
4
|
|
|
|
|
2779
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#---------------------------------------------------------------------------- |
30
|
|
|
|
|
|
|
# Public Interface Functions |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 METHODS |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 Public Interface Methods |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=over 4 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item Status |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Generate the status report |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item Basic |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Provides basic components for pages. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Currently creates a list of all known perl versions and operating systems. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item List |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
List authors for a given letter. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item Reports |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
List reports for authors dists. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=back |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub Status { |
61
|
0
|
|
|
0
|
1
|
|
my @rows = $dbi->GetQuery('hash','StatusRequest'); |
62
|
0
|
0
|
|
|
|
|
$tvars{status} = $rows[0] if(@rows); |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my @max = $dbi->GetQuery('array','MaxStatReport'); |
65
|
0
|
0
|
|
|
|
|
if(@max) { |
66
|
0
|
|
|
|
|
|
my @rep = $dbi->GetQuery('hash','GetStatReport',$max[0]->[0]); |
67
|
0
|
0
|
|
|
|
|
if(@rep) { |
68
|
0
|
|
|
|
|
|
my @date = $rep[0]->{fulldate} =~ /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/; |
69
|
0
|
|
|
|
|
|
$rep[0]->{date} = sprintf "%04d-%02d-%02d %02d:%02d:00", @date; |
70
|
0
|
|
|
|
|
|
$tvars{report} = $rep[0]; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub Basic { |
76
|
0
|
|
|
0
|
1
|
|
my $cpan = Labyrinth::Plugin::CPAN->new(); |
77
|
0
|
|
|
|
|
|
$cpan->Configure(); |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
$tvars{perlvers} = $cpan->mklist_perls; |
80
|
0
|
|
|
|
|
|
$tvars{osnames} = $cpan->osnames; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub List { |
84
|
0
|
|
|
0
|
1
|
|
($tvars{letter}) = ($cgiparams{name} =~ /^([A-Z])/i); |
85
|
0
|
|
|
|
|
|
$tvars{letter} = uc $tvars{letter}; |
86
|
0
|
0
|
|
|
|
|
return unless($tvars{letter}); |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
my @rows = $dbi->GetQuery('hash','GetAuthors',"$tvars{letter}%"); |
89
|
0
|
|
|
|
|
|
my @authors = map {$_->{author}} @rows; |
|
0
|
|
|
|
|
|
|
90
|
0
|
0
|
|
|
|
|
$tvars{list} = \@authors if(@authors); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub Reports { |
94
|
0
|
|
|
0
|
1
|
|
my $cpan = Labyrinth::Plugin::CPAN->new(); |
95
|
0
|
|
|
|
|
|
$cpan->Configure(); |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
|
|
|
$tvars{author} = $cgiparams{name}; |
98
|
0
|
|
|
|
|
|
$tvars{letter} = substr($cgiparams{name},0,1); |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# does author exist? |
101
|
0
|
|
|
|
|
|
my @rows = $dbi->GetQuery('hash','FindAuthor',$cgiparams{name}); |
102
|
0
|
0
|
|
|
|
|
unless(@rows) { |
103
|
0
|
|
|
|
|
|
$tvars{errcode} = 'NEXT'; |
104
|
0
|
|
|
|
|
|
$tvars{command} = 'cpan-authunk'; |
105
|
0
|
|
|
|
|
|
return; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
# get author summary |
109
|
0
|
|
|
|
|
|
my @summary = $dbi->GetQuery('hash','GetAuthorSummary',$cgiparams{name}); |
110
|
0
|
0
|
|
|
|
|
unless(@summary) { |
111
|
|
|
|
|
|
|
# summary doesn't exist, request a build |
112
|
0
|
0
|
|
|
|
|
unless($settings{crawler}) { |
113
|
0
|
|
|
|
|
|
$dbi->DoQuery('PushAuthor',$cgiparams{name}); |
114
|
0
|
|
|
|
|
|
$tvars{update} = 1; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
0
|
|
|
|
|
|
$tvars{perlvers} = $cpan->mklist_perls; |
118
|
0
|
|
|
|
|
|
$tvars{osnames} = $cpan->osnames; |
119
|
0
|
|
|
|
|
|
return; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
# if existing page requests, add another to improve rebuild time |
123
|
0
|
|
|
|
|
|
@rows = $dbi->GetQuery('array','GetAuthorRequests',$cgiparams{name}); |
124
|
0
|
0
|
0
|
|
|
|
if(@rows && $rows[0]->[0] > 0) { |
125
|
0
|
0
|
|
|
|
|
unless($settings{crawler}) { |
126
|
0
|
|
|
|
|
|
$dbi->DoQuery('PushAuthor',$cgiparams{name}); |
127
|
0
|
|
|
|
|
|
$tvars{update} = 1; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
# decode from JSON string |
132
|
0
|
|
|
|
|
|
my $parms = decode_json($summary[0]->{dataset}); |
133
|
0
|
|
|
|
|
|
for my $key (keys %$parms) { $tvars{$key} = $parms->{$key}; } |
|
0
|
|
|
|
|
|
|
134
|
0
|
0
|
|
|
|
|
$tvars{processed} = formatDate(8,$parms->{processed}) if($parms->{processed}); |
135
|
0
|
|
|
|
|
|
$tvars{perlvers} = $cpan->mklist_perls; |
136
|
0
|
|
|
|
|
|
$tvars{osnames} = $cpan->osnames; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
1; |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__END__ |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head1 SEE ALSO |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Labyrinth |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head1 AUTHOR |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Barbie, <barbie@missbarbell.co.uk> for |
150
|
|
|
|
|
|
|
Miss Barbell Productions, L<http://www.missbarbell.co.uk/> |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Copyright (C) 2008-2017 Barbie for Miss Barbell Productions |
155
|
|
|
|
|
|
|
All Rights Reserved. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
158
|
|
|
|
|
|
|
modify it under the Artistic License 2.0. |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=cut |