| 1 | # ====================================================================== | ||||||||||||||||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||||||||||||||||
| 3 | # Copyright (C) 2000-2001 Paul Kulchenko (paulclinger@yahoo.com) | ||||||||||||||||||||||||||||||||||||||||||
| 4 | # SOAP::Lite is free software; you can redistribute it | ||||||||||||||||||||||||||||||||||||||||||
| 5 | # and/or modify it under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||||||||||||||||
| 7 | # ====================================================================== | ||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | package SOAP::Transport::IO; | ||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | our $VERSION = '1.27'; # VERSION | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | ▶ | use IO::File; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | ▶ | use SOAP::Lite; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | # ====================================================================== | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | package SOAP::Transport::IO::Server; | ||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use Carp (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use vars qw(@ISA); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 2 | @ISA = qw(SOAP::Server); | |||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | 27 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 27 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 27 | ▶ | return $class if ref $class; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | 2 | my $self = $class->SUPER::new(@_); | |||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 2 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | 7 | ▶ | sub in { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
in: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | 7 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 37 | 7 | ▶ | $self = $self->new() if not ref $self; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 7 | ▶ | return $self->{ _in } if not @_; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 3 | my $file = shift; | |||||||||||||||||||||||||||||||||||||||||
| 42 | 3 | ▶ | $self->{_in} = (defined $file && !ref $file && !defined fileno($file)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
defined $file and not ref $file and not defined fileno $file
defined $file and not ref $file
MC/DC66%2/3
defined $file and not ref $file and not defined fileno $file
defined $file
not ref $file
not defined fileno $file
Truth table75%3/4
A and not(B) and not(C)
A= defined $fileB= not ref $fileC= not defined fileno $file
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | ? IO::File->new($file, 'r') | ||||||||||||||||||||||||||||||||||||||||||
| 44 | : $file; | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 3 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | 3 | ▶ | sub out { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
out: called CC=6 SCAR=19.9
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | 3 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||
| 50 | 3 | ▶ | $self = $self->new() if not ref $self; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | 3 | ▶ | return $self->{ _out } if not @_; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | my $file = shift; | |||||||||||||||||||||||||||||||||||||||||
| 55 | 1 | ▶ | $self->{_out} = (defined $file && !ref $file && !defined fileno($file)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $file and not ref $file and not defined fileno $file
defined $file and not ref $file
MC/DC0%0/3
defined $file and not ref $file and not defined fileno $file
defined $file
not ref $file
not defined fileno $file
Truth table25%1/4
A and not(B) and not(C)
A= defined $fileB= not ref $fileC= not defined fileno $file
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | ? IO::File->new($file, 'w') | ||||||||||||||||||||||||||||||||||||||||||
| 57 | : $file; | ||||||||||||||||||||||||||||||||||||||||||
| 58 | 1 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | 2 | ▶ | sub handle { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
handle: called CC=3 SCAR=11.2
| |||||||||||||||||||||||||||||||||||||||||||
| 62 | 2 | my $self = shift->new; | |||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | 2 | ▶ | $self->in(*STDIN)->out(*STDOUT) unless defined $self->in; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | 2 | my $in = $self->in; | |||||||||||||||||||||||||||||||||||||||||
| 66 | 2 | my $out = $self->out; | |||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||
| 68 | 2 | my $result = $self->SUPER::handle(join '', <$in>); | |||||||||||||||||||||||||||||||||||||||||
| 69 | 2 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | print {$out} $result | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 71 | if defined $out; | ||||||||||||||||||||||||||||||||||||||||||
| 72 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | # ====================================================================== | ||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||
| 77 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||
| 79 | __END__ | ||||||||||||||||||||||||||||||||||||||||||