| 1 | package OpenInteract2::Controller::Raw; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | # $Id: Raw.pm,v 1.12 2005/03/17 14:58:01 sjn Exp $ | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use base qw( OpenInteract2::Controller ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | ▶ | use Log::Log4perl qw( get_logger ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use OpenInteract2::Context qw( CTX ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use OpenInteract2::Constants qw( :log ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 1 | ▶ | use OpenInteract2::Exception qw( oi_error ); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 1 | $OpenInteract2::Controller::Raw::VERSION = sprintf("%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/); | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 1 | my ( $log ); | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 0 | ▶ | sub execute { | ||||||||||||||||||
|
Subroutine
execute: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 17 | 0 | my ( $self ) = @_; | |||||||||||||||||||
| 18 | 0 | ▶ | $log ||= get_logger( LOG_ACTION ); | ||||||||||||||||||
|
Condition0%0/3
$log ||= get_logger("OI2.ACTION")
MC/DC0%0/2
$log ||= get_logger("OI2.ACTION")
$log
get_logger("OI2.ACTION")
Truth table0%0/3
A ||= B
A= $logB= get_logger("OI2.ACTION")
| |||||||||||||||||||||
| 19 | 0 | my $action = $self->initial_action; | |||||||||||||||||||
| 20 | 0 | ▶ | $log->is_debug && | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | $log->debug( 'Executing top-level action [', $action->name, "] ", | ||||||||||||||||||||
| 22 | "with task [", $action->task, "]" ); | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | my $content = eval { $action->execute }; | |||||||||||||||||||
| 25 | 0 | ▶ | if ( $@ ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 0 | $log->error( "Caught exception generating content: $@" ); | |||||||||||||||||||
| 27 | 0 | $content = $@; | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | else { | ||||||||||||||||||||
| 30 | 0 | ▶ | $log->is_debug && | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 31 | $log->debug( "Generated content ok" ); | ||||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | # We don't need no steenkeng content generator! | ||||||||||||||||||||
| 35 | 0 | CTX->response->content( \$content ); | |||||||||||||||||||
| 36 | 0 | return $self; | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 1 | 1; | |||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | __END__ | ||||||||||||||||||||