| 1 | package CGI::Lazy::Session::Data; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use CGI::Lazy::Globals; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | #---------------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||
| 9 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 0 | my $name = our $AUTOLOAD; | |||||||||||||||||||||||||||
| 12 | 0 | ▶ | return if $name =~ /::DESTROY$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 13 | 0 | my @list = split "::", $name; | |||||||||||||||||||||||||||
| 14 | 0 | my $value = pop @list; | |||||||||||||||||||||||||||
| 15 | 0 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | 0 | $self->{_data}->{$value} = shift; #this will work equally well for scalars and array refs. Do we need it to fly for lists? | |||||||||||||||||||||||||||
| 17 | 0 | ▶ | $self->session->save unless ($self->q->plugin->session->{autowrite} && ($self->q->plugin->session->{autowrite} == 0)); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->q->plugin->session->{"autowrite"} and $self->q->plugin->session->{"autowrite"} == 0
MC/DC0%0/2
$self->q->plugin->session->{"autowrite"} and $self->q->plugin->session->{"autowrite"} == 0
$self->q->plugin->session->{"autowrite"}
$self->q->plugin->session->{"autowrite"} == 0
Truth table0%0/3
A and B
A= $self->q->plugin->session->{"autowrite"}B= $self->q->plugin->session->{"autowrite"} == 0
| |||||||||||||||||||||||||||||
| 18 | } else { | ||||||||||||||||||||||||||||
| 19 | 0 | ▶ | if (ref $self->{_data}->{$value} eq 'HASH') { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | return wantarray ? %{$self->{_data}->{$value}} : $self->{_data}->{$value}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | } elsif (ref $self->{_data}->{$value} eq 'ARRAY') { | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | return wantarray ? @{$self->{_data}->{$value}} : $self->{_data}->{$value}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | } else { | ||||||||||||||||||||||||||||
| 24 | 0 | return $self->{_data}->{$value}; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | #-------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 30 | 0 | ▶ | sub q { | ||||||||||||||||||||||||||
|
Subroutine
q: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 31 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | return $self->session->q; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | #-------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub session { | ||||||||||||||||||||||||||
|
Subroutine
session: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 38 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | return $self->{_session}; | |||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | #-------------------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 44 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 45 | 0 | my $class = shift; | |||||||||||||||||||||||||||
| 46 | 0 | my $session = shift; | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | my $self = {_session => $session, _data => $session->getData}; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | return bless $self, $class; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 1 | 1 | |||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | __END__ | ||||||||||||||||||||||||||||