| 1 | package Class::DBI::Plugin::NoCache; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use vars qw/$VERSION/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | $VERSION = 0.03; | |||||||||
| 5 | 0 | ▶ | sub import { | ||||||||
|
Subroutine
import: not called CC=2 SCAR=14.4
| |||||||||||
| 6 | 0 | my $class = shift; | |||||||||
| 7 | 0 | my $pkg = caller(0); | |||||||||
| 8 | 0 | ▶ | unless($pkg->isa('Class::DBI')){ | ||||||||
|
Branch: 1 branch
| |||||||||||
| 9 | 0 | require Carp; | |||||||||
| 10 | 0 | Carp::croak("This is a plugin for Class::DBI."); | |||||||||
| 11 | } | ||||||||||
| 12 | 0 | $pkg->mk_classdata('nocache'); | |||||||||
| 13 | 1 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 0 | my $super = $pkg->can('_init'); | |||||||||
| 15 | 0 | ▶ | *{$pkg."::_init"} = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 16 | 0 | my $caller = shift; | |||||||||
| 17 | 0 | local $Class::DBI::Weaken_Is_Available = not $caller->nocache; | |||||||||
| 18 | 0 | return $super->($caller, @_); | |||||||||
| 19 | 0 | }; | |||||||||
| 20 | } | ||||||||||
| 21 | 1 | 1; | |||||||||
| 22 | __END__ | ||||||||||