| 1 | package CGI::Lazy::Plugin; | ||||||||||
| 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 | 5 | ▶ | sub AUTOLOAD { | ||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.4
| |||||||||||
| 9 | 5 | my $self = shift; | |||||||||
| 10 | |||||||||||
| 11 | 5 | my $name = our $AUTOLOAD; | |||||||||
| 12 | 5 | ▶ | return if $name =~ /::DESTROY$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 5 | my @list = split "::", $name; | |||||||||
| 14 | 5 | my $value = pop @list; | |||||||||
| 15 | |||||||||||
| 16 | 5 | ▶ | if (@_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | return $self->{_plugins}->{$value} = shift; | |||||||||
| 18 | } else { | ||||||||||
| 19 | 5 | return $self->{_plugins}->{$value}; | |||||||||
| 20 | } | ||||||||||
| 21 | } | ||||||||||
| 22 | #------------------------------------------------------------ | ||||||||||
| 23 | 1 | ▶ | sub config { | ||||||||
|
Subroutine
config: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 24 | 1 | my $self = shift; | |||||||||
| 25 | |||||||||||
| 26 | 1 | return $self->q->config; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | #------------------------------------------------------------ | ||||||||||
| 30 | 1 | ▶ | sub q { | ||||||||
|
Subroutine
q: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 31 | 1 | my $self = shift; | |||||||||
| 32 | |||||||||||
| 33 | 1 | return $self->{_q}; | |||||||||
| 34 | } | ||||||||||
| 35 | |||||||||||
| 36 | #------------------------------------------------------------ | ||||||||||
| 37 | 1 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 38 | 1 | my $class = shift; | |||||||||
| 39 | 1 | my $q = shift; | |||||||||
| 40 | |||||||||||
| 41 | 1 | my $self = bless {_q => $q}, $class; | |||||||||
| 42 | |||||||||||
| 43 | 1 | $self->{_plugins} = $self->config->plugins; | |||||||||
| 44 | |||||||||||
| 45 | 1 | return $self; | |||||||||
| 46 | } | ||||||||||
| 47 | |||||||||||
| 48 | 1 | 1 | |||||||||
| 49 | |||||||||||
| 50 | __END__ | ||||||||||