line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTTP::Body::XForms; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$HTTP::Body::XForms::VERSION = '1.19'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
41
|
use strict; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
253
|
|
7
|
7
|
|
|
7
|
|
39
|
use base 'HTTP::Body'; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
510
|
|
8
|
7
|
|
|
7
|
|
37
|
use bytes; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
43
|
|
9
|
|
|
|
|
|
|
|
10
|
7
|
|
|
7
|
|
164
|
use File::Temp 0.14; |
|
7
|
|
|
|
|
137
|
|
|
7
|
|
|
|
|
1480
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
HTTP::Body::XForms - HTTP Body XForms Parser |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use HTTP::Body::XForms; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
HTTP Body XForms Parser. This module parses single part XForms |
23
|
|
|
|
|
|
|
submissions, which are identifiable by the content-type |
24
|
|
|
|
|
|
|
application/xml. The XML is stored unparsed on the parameter |
25
|
|
|
|
|
|
|
XForms:Model. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 METHODS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=over 4 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=item spin |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This method is overwrited to set the param XForms:Model with |
34
|
|
|
|
|
|
|
the buffer content. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub spin { |
39
|
1
|
|
|
1
|
1
|
3
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
9
|
return unless $self->length == $self->content_length; |
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
|
|
9
|
$self->body($self->{buffer}); |
44
|
1
|
|
|
|
|
9
|
$self->param( 'XForms:Model', $self->{buffer} ); |
45
|
1
|
|
|
|
|
3
|
$self->{buffer} = ''; |
46
|
1
|
|
|
|
|
3
|
$self->{state} = 'done'; |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
9
|
return $self->SUPER::init(); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=back |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Daniel Ruoso, C |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 LICENSE |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This library is free software . You can redistribute it and/or modify |
60
|
|
|
|
|
|
|
it under the same terms as perl itself. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; |