| 1 | package WWW::MLite; # $Id: MLite.pm 32 2014-08-01 10:31:31Z minus $ | ||||||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||
| 4 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||
| 6 | WWW::MLite - Lite Web Application Framework | ||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | =head1 VERSION | ||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | Version 1.05 | ||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||
| 12 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||
| 14 | use WWW::MLite; | ||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||
| 16 | =head1 ABSTRACT | ||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | WWW::MLite - Lite Web Application Framework | ||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||
| 20 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | Lite Web Application Framework | ||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||
| 24 | =head1 METHODS | ||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | =over 8 | ||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||
| 28 | =item B<new> | ||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | my $mlite = new WWW::MLite( ... args ... ); | ||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||
| 32 | Returns object | ||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||
| 34 | =item B<show> | ||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | $mlite->show( qw/foo bar baz/ ); | ||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | Run project and send data to Apache | ||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||
| 40 | =item B<register> | ||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||
| 42 | $mlite->register( qw/Foo Bar Baz/ ); | ||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||
| 44 | Register all announced modules after creating object | ||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||
| 46 | =item B<get_recs> | ||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||
| 48 | $mlite->get_recs( qw/foo bar baz/ ) | ||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||
| 50 | Get metadata as one hash | ||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||
| 52 | =item B<get_rec> | ||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||
| 54 | my $data = $mlite->get_rec( "foo" ) | ||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||
| 56 | Get data one key only | ||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||
| 58 | =item B<get_node, get> | ||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||
| 60 | my $name = $mlite->get( 'name' ); | ||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||
| 62 | Getting node by name | ||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||
| 64 | =item B<set_node, set> | ||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||
| 66 | $mlite->set( key => 'value' ); | ||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||
| 68 | Setting node by name | ||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||
| 70 | =item B<config, conf> | ||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||
| 72 | my $config = $mlite->config; | ||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||
| 74 | Getting config-node | ||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||
| 76 | =back | ||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||
| 78 | =head1 HISTORY | ||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||
| 80 | See C<CHANGES> file | ||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||
| 82 | =head1 DEPENDENCIES | ||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||
| 84 | L<CTK> | ||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||
| 86 | =head1 TO DO | ||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||
| 88 | See C<TODO> file | ||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||
| 90 | =head1 BUGS | ||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||
| 92 | * none noted | ||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||
| 94 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||
| 96 | C<perl>, L<CTK> | ||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||
| 98 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||
| 100 | Serz Minus (Lepenkov Sergey) L<http://www.serzik.com> E<lt>minus@mail333.comE<gt> | ||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||
| 102 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||
| 104 | Copyright (C) 1998-2014 D&D Corporation. All Rights Reserved | ||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||
| 106 | =head1 LICENSE | ||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||
| 108 | This program is free software: you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||
| 109 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||
| 110 | the Free Software Foundation, either version 3 of the License, or | ||||||||||||||||||||||||||||||||
| 111 | (at your option) any later version. | ||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||
| 113 | This program is distributed in the hope that it will be useful, | ||||||||||||||||||||||||||||||||
| 114 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||||||||||||||||||||||||
| 115 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||||||||||||||||||||||||
| 116 | GNU General Public License for more details. | ||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||
| 118 | See C<LICENSE> file | ||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||
| 120 | =cut | ||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||
| 122 | 1 | ▶ | use vars qw/ $VERSION /; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 123 | 1 | $VERSION = '1.05'; | |||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||
| 125 | 1 | ▶ | use Module::Load; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 126 | 1 | ▶ | use CTK::Util qw/ :API /; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 127 | 1 | ▶ | use CTK::ConfGenUtil; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 128 | 1 | ▶ | use WWW::MLite::Config; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||
| 130 | 1 | use base qw/ | |||||||||||||||||||||||||||||||
| 131 | WWW::MLite::Log | ||||||||||||||||||||||||||||||||
| 132 | WWW::MLite::Transaction | ||||||||||||||||||||||||||||||||
| 133 | 1 | ▶ | /; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||
| 135 | use constant { | ||||||||||||||||||||||||||||||||
| 136 | 1 | HANDLER => 'handler', | |||||||||||||||||||||||||||||||
| 137 | 1 | ▶ | }; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||
| 139 | sub new { | ||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | my $class = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||||||
| 141 | 0 | my %args = @_; | |||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||
| 143 | # Ïîäãðóæàåì ìîäóëü | ||||||||||||||||||||||||||||||||
| 144 | 0 | my $h_module = $args{module}; | |||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | croak("The 'module' argument missing") unless $h_module; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 146 | 0 | load $h_module; | |||||||||||||||||||||||||||||||
| 147 | #croak("Module '$h_module' can't loaded"); | ||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||
| 149 | # Ïðîâåðÿåì íàëè÷èå ãëàâíîãî õåíäëåðà | ||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | my $h_handler = $args{handler} || HANDLER; | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$args{'handler'} || 'handler'
MC/DC0%0/1
$args{'handler'} || 'handler'
$args{'handler'}
Truth table0%0/2
A
A= $args{'handler'}
| |||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | croak("The 'handler' argument missing") unless $h_handler; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 152 | 0 | my $handler = undef; | |||||||||||||||||||||||||||||||
| 153 | #eval "\$handler = $h_module->can(\$h_handler)"; croak("Method '$h_handler' not exists. $@") if $@; | ||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | croak("Method '$h_handler' not exists") unless $handler = $h_module->can($h_handler); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||
| 159 | my $self = bless { | ||||||||||||||||||||||||||||||||
| 160 | name => $args{name} || 'noname', | ||||||||||||||||||||||||||||||||
| 161 | prefix => defined($args{prefix}) ? $args{prefix} : '', | ||||||||||||||||||||||||||||||||
| 162 | module => $h_module, | ||||||||||||||||||||||||||||||||
| 163 | handler => $handler, | ||||||||||||||||||||||||||||||||
| 164 | params => $args{params}, | ||||||||||||||||||||||||||||||||
| 165 | register => _to_arrayref($args{register}), | ||||||||||||||||||||||||||||||||
| 166 | meta => {}, | ||||||||||||||||||||||||||||||||
| 167 | inheritance => $args{inheritance} ? 1 : 0, # Âêëþ÷èòü íàñëåäîâàíèå çåðåãèñòðèðîâàííûõ ìîäóëåé | ||||||||||||||||||||||||||||||||
| 168 | config => new WWW::MLite::Config( # Êîíôèãóðàöèîííûå îïöèè | ||||||||||||||||||||||||||||||||
| 169 | file => $args{config_file}, | ||||||||||||||||||||||||||||||||
| 170 | dirs => $args{config_dirs}, | ||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | ), | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/2
$args{'name'} || 'noname'
MC/DC0%0/1
$args{'name'} || 'noname'
$args{'name'}
Truth table0%0/2
A
A= $args{'name'}
| |||||||||||||||||||||||||||||||||
| 172 | }, $class; | ||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||
| 174 | # Ðåãèñòðàöèÿ ìîäóëåé, åñëè îíè çàäàíû | ||||||||||||||||||||||||||||||||
| 175 | 0 | $self->register(); | |||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||
| 177 | 0 | return $self; | |||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||
| 179 | sub show { | ||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
show: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | croak("The method call not in the WWW::MLite context") unless ref($self) =~ /WWW\:\:MLite/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 182 | 0 | return $self->{handler}->($self, @_); | |||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||
| 184 | sub register { | ||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
register: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||||||
| 186 | 0 | my @mdls = @_; | |||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | @mdls = @{($self->{register})} unless @mdls; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 188 | 0 | ▶ | return 0 unless @mdls; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||
| 190 | 0 | load $_ for @mdls; | |||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | push @WWW::MLite::ISA, @mdls if $self->{inheritance}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 192 | 0 | my $meta = $self->{meta}; | |||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||
| 194 | 0 | for (@mdls) { | |||||||||||||||||||||||||||||||
| 195 | 0 | my @rec = (); | |||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | if ($_->can("meta")) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 197 | 0 | @rec = $_->meta; | |||||||||||||||||||||||||||||||
| 198 | } else { | ||||||||||||||||||||||||||||||||
| 199 | 0 | carp("Method 'meta' not exists in $_ package"); | |||||||||||||||||||||||||||||||
| 200 | 0 | next; | |||||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||||
| 202 | 0 | $meta->{$_} = { | |||||||||||||||||||||||||||||||
| 203 | status => 'registered', | ||||||||||||||||||||||||||||||||
| 204 | actions => {@rec}, | ||||||||||||||||||||||||||||||||
| 205 | }; | ||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||
| 207 | 0 | return 1; | |||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||
| 209 | sub get_recs { | ||||||||||||||||||||||||||||||||
| 210 | # Get metadata as one hash where key = name of action, value = data of action | ||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
get_recs: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||||||
| 212 | 0 | my @rq = @_; | |||||||||||||||||||||||||||||||
| 213 | 0 | my $metas = hash($self->{meta}); | |||||||||||||||||||||||||||||||
| 214 | 0 | my %recs = (); | |||||||||||||||||||||||||||||||
| 215 | 0 | foreach my $k (keys %$metas) { | |||||||||||||||||||||||||||||||
| 216 | 0 | my $actions = hash($metas, $k, "actions"); | |||||||||||||||||||||||||||||||
| 217 | 0 | foreach my $a (keys %$actions) { | |||||||||||||||||||||||||||||||
| 218 | 0 | ▶ | if (@rq) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | next unless grep {$a eq $_} @rq; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||
| 221 | 0 | $recs{$a} = hash($actions, $a); | |||||||||||||||||||||||||||||||
| 222 | 0 | $recs{$a}{module} = $k; | |||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||
| 225 | 0 | return {%recs} | |||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||
| 227 | sub get_rec { | ||||||||||||||||||||||||||||||||
| 228 | # Get data by name of action | ||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
get_rec: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 230 | 0 | my $name = shift; | |||||||||||||||||||||||||||||||
| 231 | 0 | ▶ | return {} unless defined $name; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 232 | 0 | return hash($self->get_recs($name), $name); | |||||||||||||||||||||||||||||||
| 233 | } | ||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||
| 235 | sub get_node { | ||||||||||||||||||||||||||||||||
| 236 | # Ïðî÷èòàòü íîäó èç ãëîáàëüíîãî ìàññèâà | ||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
get_node: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 238 | 0 | my $node = shift; | |||||||||||||||||||||||||||||||
| 239 | 0 | return $self->{$node}; | |||||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | sub get { goto &get_node }; | ||||||||||||||||||||||||||||||
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 242 | sub set_node { | ||||||||||||||||||||||||||||||||
| 243 | # Äîáàâèòü íîäó ê ãëîáàëüíîìó ìàññèâó | ||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
set_node: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 245 | 0 | my $node = shift; | |||||||||||||||||||||||||||||||
| 246 | 0 | my $data = shift; | |||||||||||||||||||||||||||||||
| 247 | 0 | $self->{$node} = $data; | |||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | sub set { goto &set_node }; | ||||||||||||||||||||||||||||||
|
Subroutine
set: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | sub config { return shift->{config}; }; | ||||||||||||||||||||||||||||||
|
Subroutine
config: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | sub conf { goto &config }; | ||||||||||||||||||||||||||||||
|
Subroutine
conf: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||
| 252 | |||||||||||||||||||||||||||||||||
| 253 | sub _to_arrayref { | ||||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | my $p = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
_to_arrayref: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||
| 255 | 0 | ▶ | if ($p && ref($p) eq 'ARRAY') { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$p and ref $p eq "ARRAY"
MC/DC0%0/2
$p and ref $p eq "ARRAY"
$p
ref $p eq "ARRAY"
Truth table0%0/3
A and B
A= $pB= ref $p eq "ARRAY"
| |||||||||||||||||||||||||||||||||
| 256 | 0 | return $p; | |||||||||||||||||||||||||||||||
| 257 | } elsif (defined($p)) { | ||||||||||||||||||||||||||||||||
| 258 | 0 | return [$p]; | |||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||
| 260 | 0 | return []; | |||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||
| 262 | sub AUTOLOAD { | ||||||||||||||||||||||||||||||||
| 263 | # Ýòî ñâîåãî ðîäà èíòåðôåéñ êî âñåì ñâîéñòâàì ÷åðåç îáúåêòíóþ ìîäåëü | ||||||||||||||||||||||||||||||||
| 264 | # åñëè òàêîãî ñâîéñòâà íå îêàæèòñÿ, òî çíà÷èò ðóãàåìñÿ êàðïîì !! | ||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||
| 266 | 0 | our $AUTOLOAD; | |||||||||||||||||||||||||||||||
| 267 | 0 | my $AL = $AUTOLOAD; | |||||||||||||||||||||||||||||||
| 268 | 0 | my $ss = undef; | |||||||||||||||||||||||||||||||
| 269 | 0 | ▶ | $ss = $1 if $AL=~/\:\:([^\:]+)$/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | if ($ss && defined($self->{$ss})) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ss and defined $self->{$ss}
MC/DC0%0/2
$ss and defined $self->{$ss}
$ss
defined $self->{$ss}
Truth table0%0/3
A and B
A= $ssB= defined $self->{$ss}
| |||||||||||||||||||||||||||||||||
| 271 | 0 | return $self->{$ss}; | |||||||||||||||||||||||||||||||
| 272 | } else { | ||||||||||||||||||||||||||||||||
| 273 | 0 | carp("Can't find WWW::MLite node \"$ss\""); | |||||||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||||||
| 275 | 0 | return undef; | |||||||||||||||||||||||||||||||
| 276 | } | ||||||||||||||||||||||||||||||||
| 277 | sub DESTROY { | ||||||||||||||||||||||||||||||||
| 278 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||
| 279 | #print STDERR "Object WWW::MLite destroyed\n"; | ||||||||||||||||||||||||||||||||
| 280 | 0 | ▶ | return 1 unless $self && ref($self); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self and ref $self
MC/DC0%0/2
$self and ref $self
$self
ref $self
Truth table0%0/3
A and B
A= $selfB= ref $self
| |||||||||||||||||||||||||||||||||
| 281 | #my $oo = $self->oracle; | ||||||||||||||||||||||||||||||||
| 282 | #my $mo = $self->mysql; | ||||||||||||||||||||||||||||||||
| 283 | #my $msoo = $self->multistore; | ||||||||||||||||||||||||||||||||
| 284 | #undef $oo; | ||||||||||||||||||||||||||||||||
| 285 | #undef $mo; | ||||||||||||||||||||||||||||||||
| 286 | #undef $msoo; | ||||||||||||||||||||||||||||||||
| 287 | 0 | return 1; | |||||||||||||||||||||||||||||||
| 288 | } | ||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||
| 291 | 1 | 1; | |||||||||||||||||||||||||||||||