OpenInteract2/Manage/Website/InstallPackageSql.pm

filter: Statementstmt 48.8% 21 / 43 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 70.0% 7 / 10 Podpod 0.0% 0 / 5 totaltotal 46.6% 28 / 60 CC 2 SCAR 7.4
CC
2
Cov
47%
run_task
6.0
get_brief_description
2.0
setup_task
2.0
CRAP 2.1
« OpenInteract2/Setup/ReadRepository.pm ↑ Summary OpenInteract2/App.pm »
1 package OpenInteract2::Manage::Website::InstallPackageSql;
2  
3 # $Id: InstallPackageSql.pm,v 1.16 2005/03/18 04:09:50 lachoy Exp $
4  
5 87 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 87 ▶use base qw( OpenInteract2::Manage::Website );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 87 ▶use OpenInteract2::Context qw( CTX );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 87 ▶use OpenInteract2::Exception qw( oi_error );
Subroutine BEGIN: called CC=1 SCAR=0.0
9 87 ▶use OpenInteract2::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 87 $OpenInteract2::Manage::Website::InstallPackageSql::VERSION = sprintf("%d.%02d", q$Revision: 1.16 $ =~ /(\d+)\.(\d+)/);
12  
13 87 ▶sub get_name {
Subroutine get_name: called CC=1 SCAR=0.0
Pod undocumented
14 87 return 'install_sql';
15 }
16  
17 0 ▶sub get_brief_description {
Subroutine get_brief_description: not called CC=1 SCAR=6.9
Pod undocumented
18 0 return "Run the 'install_sql_structure', 'install_sql_data' and " .
19 "'install_sql_security' tasks in that order.";
20 }
21  
22 1 ▶sub get_parameters {
Subroutine get_parameters: called CC=1 SCAR=0.0
Pod undocumented
23 1 my ( $self ) = @_;
24 return {
25 1 website_dir => $self->_get_website_dir_param,
26 package => $self->_get_package_param,
27 file => {
28 description => 'Process only the listed structure file(s); if unspecified all are processed',
29 is_required => 'no',
30 is_multivalued => 'yes',
31 },
32 };
33 }
34  
35 0 ▶sub setup_task {
Subroutine setup_task: not called CC=1 SCAR=6.9
Pod undocumented
36 0 my ( $self ) = @_;
37 0 $self->_setup_context( { skip => 'initialize spops' } );
38 }
39  
40 0 ▶sub run_task {
Subroutine run_task: not called CC=2 SCAR=17.9
Pod undocumented
41 0 my ( $self ) = @_;
42 0 my $struct = OpenInteract2::Manage->new( 'install_sql_structure' );
43 0 $struct->param_copy_from( $self );
44 0 my $data = OpenInteract2::Manage->new( 'install_sql_data' );
45 0 $data->param_copy_from( $self );
46 0 my $security = OpenInteract2::Manage->new( 'install_sql_security' );
47 0 $security->param_copy_from( $self );
48 0 eval {
49 0 $struct->execute;
50 0 $self->_add_status( $struct->get_status );
51  
52 # Reads and initializes the SPOPS objects now that the tables
53 # are created...
54 0 OpenInteract2::Setup->run_setup_for( 'initialize spops' );
55  
56 0 $data->execute;
57 0 $self->_add_status( $data->get_status );
58  
59 0 $security->execute;
60 0 $self->_add_status( $security->get_status );
61 };
62 0 ▶ if ( $@ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 0 0
63 0 $self->_add_status_head( { is_ok => 'no',
64 message => "SQL installation failed: $@" });
65 0 oi_error $@;
66 }
67 0 $self->_add_status_head( { is_ok => 'yes',
68 message => 'SQL installation successful' } );
69 }
70  
71 87 OpenInteract2::Manage->register_factory_type( get_name() => __PACKAGE__ );
72  
73 87 1;
74  
75 __END__
« OpenInteract2/Setup/ReadRepository.pm ↑ Summary OpenInteract2/App.pm »