line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
WWW::Link::Reporter - report information about a link back to a user |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package WWW::Link::Reporter::somethingorother |
8
|
|
|
|
|
|
|
use WWW::Link::Reporter; |
9
|
|
|
|
|
|
|
sub broken {print "something..."; ... } |
10
|
|
|
|
|
|
|
sub not_found {print "or...; ... } |
11
|
|
|
|
|
|
|
sub redirected {print "other...; ... } |
12
|
|
|
|
|
|
|
sub okay ... |
13
|
|
|
|
|
|
|
sub not_perfect .... |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
This class is really a base class upon which other classes can be |
18
|
|
|
|
|
|
|
built. These classes will allow feedback to users about what the |
19
|
|
|
|
|
|
|
status of various links is. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
The class provides one facility in that it will gather some statistics |
22
|
|
|
|
|
|
|
on the links that are fed to it. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SUBCLASSES |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Here is a list of the subclasses which come in the default |
27
|
|
|
|
|
|
|
distribution. Each one should have a more detailed description (but |
28
|
|
|
|
|
|
|
probably doesn't ;-) |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=over |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item Text |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
A simple text output listing which links are broken. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=item HTML |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
An HTML page with a list of the broken links. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=item RepairForm |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Generates an HTML page which will drive C (provided with |
43
|
|
|
|
|
|
|
this package) to fix links. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=item LongList |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Runs C on files which contain broken links giving a format |
48
|
|
|
|
|
|
|
which emacs can interpret for editing (see special emacs mode |
49
|
|
|
|
|
|
|
B provided). |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item Compile |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
For use whilst checking links in a file online. Generates an emacs |
54
|
|
|
|
|
|
|
compile mode style listing which can be used to go directly to the |
55
|
|
|
|
|
|
|
line needing corrected in the editor. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=back |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Other subclasses can be created by overriding the built in methods |
60
|
|
|
|
|
|
|
(see below). |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The default class supports storing an index object which could be used |
63
|
|
|
|
|
|
|
for getting information about the link. However it doesn't do |
64
|
|
|
|
|
|
|
anything with it. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
package WWW::Link::Reporter; |
69
|
|
|
|
|
|
|
$REVISION=q$Revision: 1.10 $ ; $VERSION = sprintf ( "%d.%02d", $REVISION =~ /(\d+).(\d+)/ ); |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#default value for verbosity.. |
72
|
|
|
|
|
|
|
#$WWW::Link::Reporter::verbose=0xFF; |
73
|
|
|
|
|
|
|
$WWW::Link::Reporter::verbose=0x00; |
74
|
|
|
|
|
|
|
|
75
|
2
|
|
|
2
|
|
1937
|
use WWW::Link; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
71
|
|
76
|
2
|
|
|
2
|
|
19
|
use Carp; #or CGI::carp?? |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
4871
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 METHODS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 new WWW::Link::Reporter [$index] |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
New sets up a new reporter. If it is given a suitable index, then it |
83
|
|
|
|
|
|
|
will store this for later use during reporting. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub new ($;$) { |
88
|
1
|
|
|
1
|
1
|
72
|
my $proto = shift; |
89
|
1
|
|
33
|
|
|
8
|
my $class = ref($proto) || $proto; |
90
|
1
|
|
|
|
|
2
|
my $self = {}; |
91
|
1
|
|
|
|
|
4
|
$self->{"index"}=shift; |
92
|
1
|
50
|
0
|
|
|
5
|
ref $index or croak "index must be a reference" if defined $index; |
93
|
1
|
|
|
|
|
3
|
bless ($self, $class); |
94
|
|
|
|
|
|
|
#next come settings |
95
|
1
|
|
|
|
|
9
|
$self->{"verbose"}=$WWW::Link::Reporter::verbose; |
96
|
1
|
|
|
|
|
9
|
$self->init() ; |
97
|
1
|
|
|
|
|
8
|
$self->default_reports(); |
98
|
1
|
|
|
|
|
3
|
return $self; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 $reporter->set_index ( $index ) |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
We can set the index that we are using. |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub set_index { |
108
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
109
|
0
|
|
|
|
|
0
|
$self->{"index"}=shift; |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 $reporter->examine ( $link ) |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
The examine class calls appropriate methods of the reporter to give to |
115
|
|
|
|
|
|
|
give information about the link, depending on its status. By |
116
|
|
|
|
|
|
|
overriding the methods in the default class (see below) you can make |
117
|
|
|
|
|
|
|
any kind of report you wish. Individual method calls can be turned on |
118
|
|
|
|
|
|
|
or off using boolean variables in the object (again see below). |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Normally there's no need to override this. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub examine { |
125
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
126
|
0
|
|
|
|
|
0
|
my $link=shift; |
127
|
|
|
|
|
|
|
|
128
|
0
|
0
|
|
|
|
0
|
croak 'usage $reporter->examine($link)' unless ref $link; |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
|
|
0
|
my $url=$link->url(); |
131
|
|
|
|
|
|
|
|
132
|
0
|
0
|
|
|
|
0
|
print STDERR "WWW::Link::Reporter::examine looking at $url\n" |
133
|
|
|
|
|
|
|
if $self->{"verbose"} & 8; |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
0
|
$self->{"total"}++ ; |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
0
|
CASE: { |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
# no strict refs; |
140
|
0
|
|
|
|
|
0
|
my $redir=0; |
141
|
0
|
0
|
|
|
|
0
|
$link->is_redirected and $redir=1; |
142
|
|
|
|
|
|
|
|
143
|
0
|
|
|
|
|
0
|
foreach my $status ( "broken", "okay", "not_checked", |
144
|
|
|
|
|
|
|
"damaged", "disallowed", "unsupported" ) { |
145
|
0
|
|
|
|
|
0
|
my $testfn = "is_" . $status; |
146
|
0
|
|
|
|
|
0
|
my $reportvar = "report_" . $status; |
147
|
0
|
|
|
|
|
0
|
my $showfn = $status; |
148
|
|
|
|
|
|
|
|
149
|
0
|
0
|
|
|
|
0
|
$link->$testfn() && do { |
150
|
0
|
0
|
0
|
|
|
0
|
($self->{$reportvar} or $redir && $self->{report_redirected}) |
|
|
|
0
|
|
|
|
|
151
|
|
|
|
|
|
|
and $self->$showfn($link, $redir) ; |
152
|
0
|
|
|
|
|
0
|
last CASE; |
153
|
|
|
|
|
|
|
}; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
0
|
0
|
|
|
|
0
|
$self->{"report_unknown"} && $self->unknown($link); |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
0
|
0
|
|
|
|
0
|
print STDERR "WWW::Link::Reporter::examine finished $url\n" |
160
|
|
|
|
|
|
|
if $self->{"verbose"} & 8; |
161
|
0
|
|
|
|
|
0
|
return 0; #we reported nothing.. |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=head2 init |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
In this class init just re-initialises the statistics the class |
167
|
|
|
|
|
|
|
gathers. It is called automatically by the constructor. Generally it |
168
|
|
|
|
|
|
|
will be over-ridden by a sub class if needed. |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=cut |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub init { |
173
|
1
|
|
|
1
|
1
|
2
|
my $self=shift; |
174
|
1
|
|
|
|
|
3
|
my $setting=0; |
175
|
|
|
|
|
|
|
|
176
|
1
|
|
|
|
|
3
|
$self->{"broken_count"} = $setting; |
177
|
1
|
|
|
|
|
2
|
$self->{"okay_count"} = $setting; |
178
|
1
|
|
|
|
|
2
|
$self->{"redirected_count"} = $setting; |
179
|
1
|
|
|
|
|
2
|
$self->{"not_checked_count"} = $setting; |
180
|
1
|
|
|
|
|
3
|
$self->{"disallowed_count"} = $setting; |
181
|
1
|
|
|
|
|
3
|
$self->{"unsupported_count"} = $setting; |
182
|
1
|
|
|
|
|
24
|
$self->{"unknown_count"} = $setting; |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head2 dummy methods |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
$s->okay $s->not_perfect $s->redirected $s->broken |
188
|
|
|
|
|
|
|
$s->unsupported $s->disallowed |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
These methods are designed to be overriden in derived classes. The |
191
|
|
|
|
|
|
|
appropriate function is called by $s->examine depending on the state |
192
|
|
|
|
|
|
|
of the link. These dummy simply increment a count of each kind of |
193
|
|
|
|
|
|
|
link. The one exception is unknown which also issues a warning. |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=over |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=item broken |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
Is called when a link was found broken enough times that we consider |
200
|
|
|
|
|
|
|
it permenantly broken. Controlled $self->{"report_broken"}. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=item okay |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Is called when there link has been checked and found to be okay. This |
205
|
|
|
|
|
|
|
is controlled by $self->{"report_okay"}. N.B. this will exclude links |
206
|
|
|
|
|
|
|
which have never been checked. Use not_checked for those. |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=item damaged |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
Is called when a link was found broken, but not enough times for us to |
211
|
|
|
|
|
|
|
consider it permanently broken. Controlled by |
212
|
|
|
|
|
|
|
$self->{"report_not_perfect"}. |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
This link is exactly the kind of thing which the linkcontroller system |
215
|
|
|
|
|
|
|
was designed to avoid (links which have not been broken for long and |
216
|
|
|
|
|
|
|
will probably soon be repaired), so probably you don't want to use |
217
|
|
|
|
|
|
|
not_perfect unless for some reason you are reporting links which are |
218
|
|
|
|
|
|
|
okay or the user explicitly asks you to. |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
=item redirected |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
Is called when a redirect was returned by the server serving the |
223
|
|
|
|
|
|
|
resource. Controlled $self->{"report_redirected"}. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=item unsupported |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Is called when for some reason a link couldn't be checked at all. |
228
|
|
|
|
|
|
|
This would typically be some unsupported scheme. Controlled |
229
|
|
|
|
|
|
|
$self->{"report_unsupported"}. |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=item disallowed |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
Is called when checking of the link is disallowed. The status of the |
234
|
|
|
|
|
|
|
link its self cannot be known. $self->{"report_unsupported"}. |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=item not_checked |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
Is called when for some reason a link hasn't yet been checked. |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=item unknown |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
Is called when the status of a link is not understood by this module. |
243
|
|
|
|
|
|
|
This should normally be considered an error condition and this module |
244
|
|
|
|
|
|
|
produces a warning. |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=back |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=cut |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
sub heading { |
251
|
0
|
|
|
0
|
0
|
0
|
1; |
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
sub footer { |
255
|
0
|
|
|
0
|
0
|
0
|
1; |
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
sub broken { |
259
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
260
|
0
|
|
|
|
|
0
|
$self->{"broken_count"} ++; |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
sub okay { |
264
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
265
|
0
|
|
|
|
|
0
|
$self->{"okay_count"} ++; |
266
|
|
|
|
|
|
|
} |
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
sub damaged { |
269
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
270
|
0
|
|
|
|
|
0
|
$self->{"damaged_count"} ++; |
271
|
|
|
|
|
|
|
} |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
sub redirected { |
274
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
275
|
0
|
|
|
|
|
0
|
$self->{"redirected_count"} ++; |
276
|
|
|
|
|
|
|
} |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
sub not_checked { |
279
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
280
|
0
|
|
|
|
|
0
|
$self->{"not_checked_count"} ++; |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
sub disallowed { |
284
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
285
|
0
|
|
|
|
|
0
|
$self->{"disallowed_count"} ++; |
286
|
|
|
|
|
|
|
} |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
sub unsupported { |
289
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
290
|
0
|
|
|
|
|
0
|
$self->{"unsupported_count"} ++; |
291
|
|
|
|
|
|
|
} |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
sub unknown { |
294
|
0
|
|
|
0
|
1
|
0
|
my ($self,$link)=@_; |
295
|
0
|
|
|
|
|
0
|
warn "link found with an unknown status " . $link->url(); |
296
|
0
|
|
|
|
|
0
|
$self->{"unknown_count"} ++; |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
=head2 not_found |
300
|
|
|
|
|
|
|
|
301
|
|
|
|
|
|
|
This method should be called from outside the module when a link which |
302
|
|
|
|
|
|
|
should be in the links database isn't there. |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=cut |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
sub not_found { |
307
|
0
|
|
|
0
|
1
|
0
|
carp "link not found in database"; |
308
|
|
|
|
|
|
|
} |
309
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=head2 all_reports |
311
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
This sets the flag about what we will report for every single kind of |
313
|
|
|
|
|
|
|
report and can be used to make a very noisy or a very quiet reporter. |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
=cut |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
sub all_reports { |
318
|
0
|
|
|
0
|
1
|
0
|
my $self=shift; |
319
|
0
|
|
|
|
|
0
|
my $setting=shift; |
320
|
|
|
|
|
|
|
|
321
|
0
|
|
|
|
|
0
|
$self->{"report_broken"} = $setting; |
322
|
0
|
|
|
|
|
0
|
$self->{"report_okay"} = $setting; |
323
|
0
|
|
|
|
|
0
|
$self->{"report_damaged"} = $setting; |
324
|
0
|
|
|
|
|
0
|
$self->{"report_redirected"} = $setting; |
325
|
0
|
|
|
|
|
0
|
$self->{"report_not_checked"} = $setting; |
326
|
0
|
|
|
|
|
0
|
$self->{"report_disallowed"} = $setting; |
327
|
0
|
|
|
|
|
0
|
$self->{"report_unsupported"} = $setting; |
328
|
0
|
|
|
|
|
0
|
$self->{"report_unknown"} = $setting; |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
} |
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=head2 default_reports |
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
This sets a sensible set of default reporting as follows. |
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
$self->{"report_broken"} = 1; |
337
|
|
|
|
|
|
|
$self->{"report_okay"} = 0; |
338
|
|
|
|
|
|
|
$self->{"report_damaged"} = 0; |
339
|
|
|
|
|
|
|
$self->{"report_redirected"} = 1; |
340
|
|
|
|
|
|
|
$self->{"report_not_checked"} = 0; |
341
|
|
|
|
|
|
|
$self->{"report_disallowed"} = 1; |
342
|
|
|
|
|
|
|
$self->{"report_unsupported"} = 0; |
343
|
|
|
|
|
|
|
$self->{"report_unknown"} = 1; |
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
You can override it no problem. |
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=cut |
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
sub default_reports { |
350
|
1
|
|
|
1
|
1
|
2
|
my $self=shift; |
351
|
|
|
|
|
|
|
|
352
|
1
|
|
|
|
|
12
|
$self->{"report_broken"} = 1; |
353
|
1
|
|
|
|
|
3
|
$self->{"report_okay"} = 0; |
354
|
1
|
|
|
|
|
3
|
$self->{"report_damaged"} = 0; |
355
|
1
|
|
|
|
|
2
|
$self->{"report_redirected"} = 1; |
356
|
1
|
|
|
|
|
1
|
$self->{"report_not_checked"} = 0; |
357
|
1
|
|
|
|
|
2
|
$self->{"report_disallowed"} = 1; |
358
|
1
|
|
|
|
|
4
|
$self->{"report_unsupported"} = 0; |
359
|
1
|
|
|
|
|
2
|
$self->{"report_unknown"} = 1; |
360
|
|
|
|
|
|
|
} |
361
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
=head1 report_not_perfect() |
363
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
this is a convenience function which turns on reports for all link |
365
|
|
|
|
|
|
|
apart from those which are okay. |
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=cut |
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
sub report_not_perfect () { |
370
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
371
|
0
|
|
|
|
|
|
$self->all_reports(1); |
372
|
0
|
|
|
|
|
|
$self->report_okay(0); |
373
|
|
|
|
|
|
|
} |
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
=head1 report_good() |
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
This sets reporting which should show all links which are probably not |
378
|
|
|
|
|
|
|
broken. Currently that defininition includes all redirected links and |
379
|
|
|
|
|
|
|
those that are unsupported etc. Excludes are broken links and ones |
380
|
|
|
|
|
|
|
where checking is disallowed. |
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
Since this function is designed for automatic link page |
383
|
|
|
|
|
|
|
maintainainance, however, as any other ways of detecting broken links |
384
|
|
|
|
|
|
|
are discovered, those links will be excluded. |
385
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
=cut |
387
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
sub report_good () { |
389
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
390
|
0
|
|
|
|
|
|
$self->all_reports(1); |
391
|
0
|
|
|
|
|
|
$self->report_broken(0); |
392
|
0
|
|
|
|
|
|
$self->report_disallowed(0); |
393
|
|
|
|
|
|
|
} |
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=head1 INDIVIDUAL REPORTS |
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
The following functions allow individual reporting functions to be |
398
|
|
|
|
|
|
|
turned on or off if called with a value (1 turns the report on, 0 |
399
|
|
|
|
|
|
|
turns it off). |
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
If called with no value they simply return the current status of that |
402
|
|
|
|
|
|
|
report. |
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
=over 4 |
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=item * |
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
report_broken |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
=item * |
411
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
report_okay |
413
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
=item * |
415
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
report_damaged |
417
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
=item * |
419
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
report_redirected |
421
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
=item * |
423
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
report_not_checked |
425
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
=item * |
427
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
report_disallowed |
429
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
=item * |
431
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
report_unsupported |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
=back |
435
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=cut |
437
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
sub report_broken (;$) { |
439
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
440
|
0
|
0
|
|
|
|
|
$self->{"report_broken"} = $value if defined $value; |
441
|
0
|
|
|
|
|
|
$self->{"report_broken"}; |
442
|
|
|
|
|
|
|
} |
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
sub report_okay (;$) { |
445
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
446
|
0
|
0
|
|
|
|
|
$self->{"report_okay"} = $value if defined $value; |
447
|
0
|
|
|
|
|
|
$self->{"report_okay"}; |
448
|
|
|
|
|
|
|
} |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
sub report_damaged (;$) { |
451
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
452
|
0
|
0
|
|
|
|
|
$self->{"report_damaged"} = $value if defined $value; |
453
|
0
|
|
|
|
|
|
$self->{"report_damaged"}; |
454
|
|
|
|
|
|
|
} |
455
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
sub report_redirected (;$) { |
457
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
458
|
0
|
0
|
|
|
|
|
$self->{"report_redirected"} = $value if defined $value; |
459
|
0
|
|
|
|
|
|
$self->{"report_redirected"}; |
460
|
|
|
|
|
|
|
} |
461
|
|
|
|
|
|
|
|
462
|
|
|
|
|
|
|
sub report_not_checked (;$) { |
463
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
464
|
0
|
0
|
|
|
|
|
$self->{"report_not_checked"} = $value if defined $value; |
465
|
0
|
|
|
|
|
|
$self->{"report_not_checked"}; |
466
|
|
|
|
|
|
|
} |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
sub report_disallowed (;$) { |
469
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
470
|
0
|
0
|
|
|
|
|
$self->{"report_disallowed"} = $value if defined $value; |
471
|
0
|
|
|
|
|
|
$self->{"report_disallowed"}; |
472
|
|
|
|
|
|
|
} |
473
|
|
|
|
|
|
|
|
474
|
|
|
|
|
|
|
sub report_unsupported (;$) { |
475
|
0
|
|
|
0
|
0
|
|
my ($self,$value)=@_; |
476
|
0
|
0
|
|
|
|
|
$self->{"report_unsupported"} = $value if defined $value; |
477
|
0
|
|
|
|
|
|
$self->{"report_unsupported"}; |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
1; |
481
|
|
|
|
|
|
|
|