DumpFile/Pages.pm

filter: Statementstmt 81.5% 230 / 282 Branchbran 60.8% 56 / 92 Conditioncond 46.6% 7 / 15 MC/DCmcdc 30.0% 3 / 10 Subroutinesub 88.8% 56 / 63 Podpod 83.3% 5 / 6 totaltotal 76.2% 357 / 468 CC 53 SCAR 18.6
CC
53
Cov
75%
next
25.7
new
15.0
completed
12.0
CRAP 6.4
↑ Summary DumpFile/SQL.pm »
1 package MediaWiki::DumpFile::Pages;
2  
3 8 our $VERSION = '0.2.2';
4 8 our $TESTED_SCHEMA_VERSION = 0.5;
5  
6 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 8 ▶use Scalar::Util qw(reftype);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 8 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 8 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 8 ▶use XML::TreePuller;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 8 ▶use XML::LibXML::Reader;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 8 ▶use IO::Uncompress::AnyUncompress qw($AnyUncompressError);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 11 ▶sub new {
Subroutine new: called CC=12 SCAR=27.1
Pod documented
17 11 my ($class, @args) = @_;
18 11 my $self = {};
19 11 my $reftype;
20 my $xml;
21 11 my $input;
22 11 my %conf;
23 11 my $io;
24
25 11 bless($self, $class);
26
27 11 $self->{siteinfo} = undef;
28 11 $self->{version} = undef;
29 11 $self->{fast_mode} = undef;
30 11 $self->{version_ignore} = 1;
31
32 11 ▶ if (scalar(@args) == 0) {
Branch: 3 branches
BranchTrueFalseTotal
if (scalar @args == 0) { } 0 11 11
elsif (scalar @args == 1) { } 9 2 11
elsif (!scalar(@args) % 2) { } 0 2 2
33 0 croak "must specify a file path or open file handle object or a hash of options";
34 } elsif (scalar(@args) == 1) {
35 9 $input = $args[0];
36 } elsif (! scalar(@args) % 2) {
37 0 croak "must specify a hash as an argument";
38 } else {
39 2 %conf = @args;
40
41 2 ▶ if (! defined($input = $conf{input})) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined($input = $conf{"input"})) 0 2 2
42 0 croak "input is a required option";
43 }
44
45 2 ▶ if (defined($conf{fast_mode})) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $conf{"fast_mode"}) 2 0 2
46 2 $self->{fast_mode} = $conf{fast_mode};
47 }
48
49 2 ▶ if (defined($conf{strict})) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $conf{"strict"}) 0 2 2
50 0 $self->{version_ignore} = $conf{version_ignore};
51 }
52 }
53
54 11 $reftype = reftype($input);
55
56 11 ▶ if (! defined($reftype)) {
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $reftype) { } 7 4 11
elsif ($reftype ne 'GLOB') { } 0 4 4
57 7 ▶ if (! -e $input) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e $input) 0 7 7
58 0 croak("$input is not a file");
59 }
60
61 } elsif ($reftype ne 'GLOB') {
62 0 croak('must provide a GLOB reference');
63 }
64
65 11 $self->{input} = $input;
66 11 $io = IO::Uncompress::AnyUncompress->new($input);
67 11 $xml = $self->_new_puller(IO => $io);
68
69 11 ▶ if (exists($ENV{MEDIAWIKI_DUMPFILE_VERSION_IGNORE})) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $ENV{"MEDIAWIKI_DUMPFILE_VERSION_IGNORE"}) 0 11 11
70 0 $self->{version_ignore} = $ENV{MEDIAWIKI_DUMPFILE_VERSION_IGNORE};
71 }
72
73 11 ▶ if (exists($ENV{MEDIAWIKI_DUMPFILE_FAST_MODE})) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $ENV{"MEDIAWIKI_DUMPFILE_FAST_MODE"}) 0 11 11
74 0 $self->{fast_mode} = $ENV{MEDIAWIKI_DUMPFILE_FAST_MODE};
75 }
76
77 11 $self->{xml} = $xml;
78 11 $self->{reader} = $xml->reader;
79 11 $self->{input} = $input;
80 11 $self->{io} = $io;
81  
82 11 $self->_init_xml;
83
84 11 return $self;
85 }
86  
87 34 ▶sub next {
Subroutine next: called CC=9 SCAR=32.5
Pod documented
88 34 my ($self, $fast) = @_;
89 34 my $version;
90 my $new;
91
92 34 ▶ if ($fast || $self->{fast_mode}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fast or $self->{"fast_mode"}) 0 34 34
Condition33%1/3
$fast or $self->{"fast_mode"}
l!l&&r!l&&!r
0034
MC/DC0%0/2
$fast or $self->{"fast_mode"}
$fast $self->{"fast_mode"}
Truth table33%1/3
A or B
A= $fastB= $self->{"fast_mode"}
ABresult
1X1
011
000
93 0 my ($title, $text);
94
95 0 ▶ if ($self->{finished}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"finished"}) 0 0 0
96 0 return ();
97 }
98
99 0 eval { ($title, $text) = $self->_fast_next; };
100
101 0 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 0 0
102 0 chomp($_);
103 0 croak("E_XML_PARSE_FAILED \"$@\" see the ERRORS section of the MediaWiki::DumpFile::Pages Perl module documentation for what to do");
104 }
105
106 0 ▶ unless (defined($title)) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $title) 0 0 0
107 0 $self->{finished} = 1;
108 0 return ();
109 }
110
111 0 return MediaWiki::DumpFile::Pages::FastPage->new($title, $text);
112 }
113  
114 34 ▶ if ($self->{finished}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"finished"}) 0 34 34
115 0 return undef;
116 }
117
118 34 $version = $self->{version};
119 34 eval { $new = $self->{xml}->next; };
120
121 34 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 34 34
122 0 chomp($_);
123 0 croak("E_XML_PARSE_FAILED \"$@\" see the ERRORS section of the MediaWiki::DumpFile::Pages Perl module documentation for what to do");
124 }
125
126 34 ▶ unless (defined($new)) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $new) 6 28 34
127 6 $self->{finished} = 1;
128 6 return undef;
129 }
130
131 28 return MediaWiki::DumpFile::Pages::Page->new($new, $version);
132 }
133  
134 5 ▶sub size {
Subroutine size: called CC=4 SCAR=14.2
Pod documented
135 5 my $source = $_[0]->{input};
136
137 5 ▶ unless(defined($source) && ref($source) eq '') {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $source and ref $source eq "") 2 3 5
Condition66%2/3
defined $source and ref $source eq ""
!ll&&!rl&&r
023
MC/DC50%1/2
defined $source and ref $source eq ""
defined $source ref $source eq ""
Truth table66%2/3
A and B
A= defined $sourceB= ref $source eq ""
ABresult
0X0
100
111
138 2 return undef;
139 }
140
141 #if we are decompressing a file on the fly then don't report the size
142 #of the file because we don't actually know the uncompressed size,
143 #only the compressed size
144 3 ▶ if (defined($_[0]->{io}->getHeaderInfo)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $_[0]{"io"}->getHeaderInfo) 0 3 3
145 0 return undef;
146 }
147
148 3 my @stat = stat($source);
149 3 return $stat[7];
150 }
151  
152 8 ▶sub current_byte {
Subroutine current_byte: called CC=1 SCAR=0.0
Pod documented
153 8 return $_[0]->{xml}->reader->byteConsumed;
154 }
155  
156 0 ▶sub completed {
Subroutine completed: not called CC=3 SCAR=24.8
Pod undocumented
157 0 my ($self) = @_;
158 0 my $size = $self->size;
159 0 my $current = $self->current_byte;
160
161 0 ▶ return -1 unless (defined($size) && defined($current));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $size and defined $current 0 0 0
Condition0%0/3
defined $size and defined $current
!ll&&!rl&&r
000
MC/DC0%0/2
defined $size and defined $current
defined $size defined $current
Truth table0%0/3
A and B
A= defined $sizeB= defined $current
ABresult
0X0
100
111
162
163 0 return int($current / $size * 100);
164 }
165  
166 6 ▶sub version {
Subroutine version: called CC=1 SCAR=0.0
Pod documented
167 6 return $_[0]->{version};
168 }
169  
170 #private methods
171  
172 11 ▶sub _init_xml {
Subroutine _init_xml: called CC=3 SCAR=11.1
173 11 my ($self) = @_;
174 11 my $xml = $self->{xml};
175 11 my $version;
176
177 11 $xml->iterate_at('/mediawiki', 'short');
178 11 $xml->iterate_at('/mediawiki/siteinfo', 'subtree');
179 11 $xml->iterate_at('/mediawiki/page', 'subtree');
180
181 11 $version = $self->{version} = $xml->next->attribute('version');
182  
183 11 ▶ unless ($self->{version_ignore}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"version_ignore"}) 0 11 11
184 0 $self->_version_enforce($version);
185 }
186
187 11 ▶ if ($version > 0.2) {
Branch: 1 branch
BranchTrueFalseTotal
if ($version > "0.2") 11 0 11
188 11 $self->{siteinfo} = $xml->next;
189
190 11 bless($self, 'MediaWiki::DumpFile::PagesSiteinfo');
191 }
192
193 11 return undef;
194 }
195  
196 0 ▶sub _version_enforce {
Subroutine _version_enforce: not called CC=3 SCAR=24.8
197 0 my ($self, $version) = @_;
198  
199 0 ▶ if ($version > $TESTED_SCHEMA_VERSION) {
Branch: 1 branch
BranchTrueFalseTotal
if ($version > $MediaWiki::DumpFile::Pages::TESTED_SCHEMA_VERSION) 0 0 0
200 0 my $filename;
201 my $msg;
202
203 0 ▶ if (ref($self->{input}) eq '') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self->{'input'} eq '') { } 0 0 0
204 0 $filename = $self->{input};
205 } else {
206 0 $filename = ref($self->{input});
207 }
208
209 0 $msg = "E_UNTESTED_DUMP_VERSION Version $version dump file \"$filename\" has not been tested with ";
210 0 $msg .= __PACKAGE__ . " version $VERSION; see the ERRORS section of the MediaWiki::DumpFile::Pages Perl module documentation for what to do";
211  
212 0 die $msg;
213 }
214  
215 }
216  
217 11 ▶sub _new_puller {
Subroutine _new_puller: called CC=2 SCAR=7.5
218 11 my ($self, @args) = @_;
219 11 my $ret;
220
221 11 eval { $ret = XML::TreePuller->new(@args) };
222
223 11 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 11 11
224 0 chomp($@);
225 0 croak("E_XML_CREATE_FAILED \"$@\" see the ERRORS section of the MediaWiki::DumpFile::Pages Perl module documentation for what to do")
226 }
227
228 11 return $ret;
229 }
230  
231 12 ▶sub _get_text {
Subroutine _get_text: called CC=7 SCAR=19.8
232 12 my ($self) = @_;
233 12 my $r = $self->{reader};
234 12 my @buffer;
235 my $type;
236  
237 12 ▶ while($r->nodeType != XML_READER_TYPE_TEXT && $r->nodeType != XML_READER_TYPE_END_ELEMENT) {
Branch: 1 branch
BranchTrueFalseTotal
if ($r->nodeType != 3 and $r->nodeType != 15) 12 12 24
Condition66%2/3
$r->nodeType != 3 and $r->nodeType != 15
!ll&&!rl&&r
12012
MC/DC50%1/2
$r->nodeType != 3 and $r->nodeType != 15
$r->nodeType != 3 $r->nodeType != 15
Truth table66%2/3
A and B
A= $r->nodeType != 3B= $r->nodeType != 15
ABresult
0X0
100
111
238 12 ▶ $r->read or die "could not read";
Branch: 1 branch
BranchTrueFalseTotal
$r->read or die "could not read" 12 0 12
239 }
240  
241 12 ▶ while($r->nodeType != XML_READER_TYPE_END_ELEMENT) {
Branch: 1 branch
BranchTrueFalseTotal
if ($r->nodeType != 15) 12 12 24
242 12 ▶ if ($r->nodeType == XML_READER_TYPE_TEXT) {
Branch: 1 branch
BranchTrueFalseTotal
if ($r->nodeType == 3) 12 0 12
243 12 push(@buffer, $r->value);
244 }
245
246 12 ▶ $r->read or die "could not read";
Branch: 1 branch
BranchTrueFalseTotal
$r->read or die "could not read" 12 0 12
247 }
248  
249 12 return join('', @buffer);
250 }
251  
252 8 ▶sub _fast_next {
Subroutine _fast_next: called CC=9 SCAR=22.1
253 8 my ($self) = @_;
254 8 my $reader = $self->{reader};
255 8 my ($title, $text);
256
257 8 ▶ if ($self->{finished}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"finished"}) 0 8 8
258 0 return ();
259 }
260
261 8 while(1) {
262 22 my $type = $reader->nodeType;
263
264 22 ▶ if ($type == XML_READER_TYPE_ELEMENT) {
Branch: 1 branch
BranchTrueFalseTotal
if ($type == 1) 18 4 22
265 18 ▶ if ($reader->name eq 'title') {
Branch: 2 branches
BranchTrueFalseTotal
if ($reader->name eq 'title') { } 6 12 18
elsif ($reader->name eq 'text') { } 6 6 12
266 6 $title = $self->_get_text();
267 6 ▶ last unless $reader->nextElement('text') == 1;
Branch: 1 branch
BranchTrueFalseTotal
unless $reader->nextElement("text") == 1 0 6 6
268 6 next;
269 } elsif ($reader->name eq 'text') {
270 6 $text = $self->_get_text();
271 6 $reader->nextElement('page');
272 6 last;
273 }
274 }
275
276 10 ▶ last unless $reader->nextElement == 1;
Branch: 1 branch
BranchTrueFalseTotal
unless $reader->nextElement == 1 2 8 10
277 }
278
279 8 ▶ if (! defined($title) || ! defined($text)) {
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $title and defined $text) 2 6 8
Condition66%2/3
defined $title and defined $text
!ll&&!rl&&r
206
MC/DC50%1/2
defined $title and defined $text
defined $title defined $text
Truth table66%2/3
A and B
A= defined $titleB= defined $text
ABresult
0X0
100
111
280 2 $self->{finished} = 1;
281 2 return ();
282 }
283  
284 6 return($title, $text);
285 }
286  
287 package MediaWiki::DumpFile::PagesSiteinfo;
288  
289 8 ▶use base qw(MediaWiki::DumpFile::Pages);
Subroutine BEGIN: called CC=1 SCAR=0.0
290  
291 8 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
292  
293 8 ▶use MediaWiki::DumpFile::Pages::Lib qw(_safe_text);
Subroutine BEGIN: called CC=1 SCAR=0.0
294  
295 22 ▶sub _site_info {
Subroutine _site_info: called CC=1 SCAR=0.0
296 22 my ($self, $name) = @_;
297 22 my $siteinfo = $self->{siteinfo};
298
299 22 return _safe_text($siteinfo, $name);
300 }
301  
302 6 ▶sub sitename {
Subroutine sitename: called CC=1 SCAR=0.0
303 6 return $_[0]->_site_info('sitename');
304 }
305  
306 6 ▶sub base {
Subroutine base: called CC=1 SCAR=0.0
307 6 return $_[0]->_site_info('base');
308 }
309  
310 4 ▶sub generator {
Subroutine generator: called CC=1 SCAR=0.0
311 4 return $_[0]->_site_info('generator');
312 }
313  
314 6 ▶sub case {
Subroutine case: called CC=1 SCAR=0.0
315 6 return $_[0]->_site_info('case');
316 }
317  
318 7 ▶sub namespaces {
Subroutine namespaces: called CC=1 SCAR=0.0
319 7 my ($self) = @_;
320 7 my @e = $self->{siteinfo}->get_elements('namespaces/namespace');
321 7 my %ns;
322
323 7 map({ $ns{ $_->attribute('key') } = $_->text } @e);
324  
325 7 return %ns;
326 }
327  
328 package MediaWiki::DumpFile::Pages::Page;
329  
330 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
331 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
332 8 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
333  
334 8 ▶use MediaWiki::DumpFile::Pages::Lib qw(_safe_text);
Subroutine BEGIN: called CC=1 SCAR=0.0
335  
336 28 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
337 28 my ($class, $element, $version) = @_;
338 28 my $self = { tree => $element };
339
340 28 bless($self, $class);
341
342 28 ▶ if ($version >= 0.4) {
Branch: 1 branch
BranchTrueFalseTotal
if ($version >= "0.4") 0 28 28
343 0 bless ($self, 'MediaWiki::DumpFile::Pages::Page000004000');
344 }
345
346 28 return $self;
347 }
348  
349 42 ▶sub title {
Subroutine title: called CC=1 SCAR=0.0
350 42 return _safe_text($_[0]->{tree}, 'title');
351 }
352  
353 24 ▶sub id {
Subroutine id: called CC=1 SCAR=0.0
354 24 return _safe_text($_[0]->{tree}, 'id');
355 }
356  
357 94 ▶sub revision {
Subroutine revision: called CC=3 SCAR=11.0
358 94 my ($self) = @_;
359 94 my @revisions;
360
361 94 foreach ($self->{tree}->get_elements('revision')) {
362 103 push(@revisions, MediaWiki::DumpFile::Pages::Page::Revision->new($_));
363 }
364
365 94 ▶ if (wantarray()) {
Branch: 1 branch
BranchTrueFalseTotal
if (wantarray) 24 70 94
366 24 return (@revisions);
367 }
368
369 70 return pop(@revisions);
370 }
371  
372 package MediaWiki::DumpFile::Pages::Page000004000;
373  
374 8 ▶use base qw(MediaWiki::DumpFile::Pages::Page);
Subroutine BEGIN: called CC=1 SCAR=0.0
375  
376 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
377 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
378  
379 0 ▶sub redirect {
Subroutine redirect: not called CC=2 SCAR=17.9
380 0 ▶ return 1 if defined $_[0]->{tree}->get_elements('redirect');
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[0]{"tree"}->get_elements("redirect") 0 0 0
381 0 return 0;
382 }
383  
384  
385 package MediaWiki::DumpFile::Pages::Page::Revision;
386  
387 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
388 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
389  
390 8 ▶use MediaWiki::DumpFile::Pages::Lib qw(_safe_text);
Subroutine BEGIN: called CC=1 SCAR=0.0
391  
392 103 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
393 103 my ($class, $tree) = @_;
394 103 my $self = { tree => $tree };
395
396 103 return bless($self, $class);
397 }
398  
399 44 ▶sub text {
Subroutine text: called CC=1 SCAR=0.0
400 44 return _safe_text($_[0]->{tree}, 'text');
401 }
402  
403 16 ▶sub id {
Subroutine id: called CC=1 SCAR=0.0
404 16 return _safe_text($_[0]->{tree}, 'id');
405 }
406  
407 24 ▶sub timestamp {
Subroutine timestamp: called CC=1 SCAR=0.0
408 24 return _safe_text($_[0]->{tree}, 'timestamp');
409 }
410  
411 8 ▶sub comment {
Subroutine comment: called CC=1 SCAR=0.0
412 8 return _safe_text($_[0]->{tree}, 'comment');
413 }
414  
415 18 ▶sub minor {
Subroutine minor: called CC=2 SCAR=6.9
416 18 ▶ return 1 if defined $_[0]->{tree}->get_elements('minor');
Branch: 1 branch
BranchTrueFalseTotal
if defined $_[0]{"tree"}->get_elements("minor") 14 4 18
417 4 return 0;
418 }
419  
420 70 ▶sub contributor {
Subroutine contributor: called CC=1 SCAR=0.0
421 return MediaWiki::DumpFile::Pages::Page::Revision::Contributor->new(
422 70 $_[0]->{tree}->get_elements('contributor') );
423 }
424  
425 package MediaWiki::DumpFile::Pages::Page::Revision::Contributor;
426  
427 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
428 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
429  
430 8 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
431  
432 use overload
433 8 ▶ '""' => 'astext',
Subroutine BEGIN: called CC=1 SCAR=0.0
434 8 fallback => 'TRUE';
435  
436 70 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
437 70 my ($class, $tree) = @_;
438 70 my $self = { tree => $tree };
439
440 70 return bless($self, $class);
441 }
442  
443 8 ▶sub astext {
Subroutine astext: called CC=2 SCAR=6.9
444 8 my ($self) = @_;
445
446 8 ▶ if (defined($self->ip)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->ip) 4 4 8
447 4 return $self->ip;
448 }
449
450 4 return $self->username;
451 }
452  
453 30 ▶sub username {
Subroutine username: called CC=2 SCAR=6.9
454 30 my $user = $_[0]->{tree}->get_elements('username');
455
456 30 ▶ return undef unless defined $user;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $user 6 24 30
457
458 24 return $user->text;
459 }
460  
461 26 ▶sub id {
Subroutine id: called CC=2 SCAR=6.9
462 26 my $id = $_[0]->{tree}->get_elements('id');
463
464 26 ▶ return undef unless defined $id;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $id 4 22 26
465
466 22 return $id->text;
467 }
468  
469 22 ▶sub ip {
Subroutine ip: called CC=2 SCAR=6.9
470 22 my $ip = $_[0]->{tree}->get_elements('ip');
471
472 22 ▶ return undef unless defined $ip;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $ip 8 14 22
473
474 14 return $ip->text;
475 }
476  
477 package MediaWiki::DumpFile::Pages::FastPage;
478  
479 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
480 0 my ($class, $title, $text) = @_;
481 0 my $self = { title => $title, text => $text };
482
483 0 bless($self, $class);
484
485 0 return $self;
486 }
487  
488 0 ▶sub title {
Subroutine title: not called CC=1 SCAR=6.9
489 0 return $_[0]->{title};
490 }
491  
492 0 ▶sub text {
Subroutine text: not called CC=1 SCAR=6.9
493 0 return $_[0]->{text};
494 }
495  
496 0 ▶sub revision {
Subroutine revision: not called CC=1 SCAR=6.9
497 0 return $_[0];
498 }
499  
500 8 1;
501  
502 __END__
↑ Summary DumpFile/SQL.pm »