OpenInteract2/Brick/Daemon.pm

filter: Statementstmt 94.7% 18 / 19 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 81.2% 26 / 32 CC 2 SCAR 2.4
CC
2
Cov
90%
load
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« OpenInteract2/Manage/Website/CreateSecurityForAction.pm ↑ Summary OpenInteract2/Brick/Messages.pm »
1 package OpenInteract2::Brick::Daemon;
2  
3 87 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 87 ▶use base qw( OpenInteract2::Brick );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 87 ▶use OpenInteract2::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 87 my %INLINED_SUBS = (
8 'oi2_daemon.ini' => 'OI2_DAEMONINI',
9 );
10  
11 87 ▶sub get_name {
Subroutine get_name: called CC=1 SCAR=0.0
Pod undocumented
12 87 return 'daemon';
13 }
14  
15 2 ▶sub get_resources {
Subroutine get_resources: called CC=1 SCAR=0.0
Pod undocumented
16 return (
17 2 'oi2_daemon.ini' => [ 'conf oi2_daemon.ini', 'yes' ],
18 );
19 }
20  
21 1 ▶sub load {
Subroutine load: called CC=2 SCAR=7.4
Pod undocumented
22 1 my ( $self, $resource_name ) = @_;
23 1 my $inline_sub_name = $INLINED_SUBS{ $resource_name };
24 1 ▶ unless ( $inline_sub_name ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($inline_sub_name) 0 1 1
25 0 OpenInteract2::Exception->throw(
26 "Resource name '$resource_name' not found ",
27 "in ", ref( $self ), "; cannot load content." );
28 }
29 1 return $self->$inline_sub_name();
30 }
31  
32 87 OpenInteract2::Brick->register_factory_type( get_name() => __PACKAGE__ );
33  
34 =pod
35  
36 =head1 NAME
37  
38 OpenInteract2::Brick::Daemon - Configuration used for creating the standalone webserver
39  
40 =head1 SYNOPSIS
41  
42 oi2_manage create_website --website_dir=/path/to/site
43  
44 =head1 DESCRIPTION
45  
46 This class holds resources for configuring the standalone webserver daemon.
47  
48 These resources are associated with OpenInteract2 version 1.99_06.
49  
50 =head2 Resources
51  
52 You can grab resources individually using the names below and
53 C<load_resource()> and C<copy_resources_to()>, or you can copy all the
54 resources at once using C<copy_all_resources_to()> -- see
55 L<OpenInteract2::Brick> for details.
56  
57 =over 4
58  
59  
60 =item B<oi2_daemon.ini>
61  
62  
63 =back
64  
65 =head1 COPYRIGHT
66  
67 Copyright (c) 2005 Chris Winters. All rights reserved.
68  
69 This library is free software; you can redistribute it and/or modify
70 it under the same terms as Perl itself.
71  
72 =head1 AUTHORS
73  
74  
75 Chris Winters E<lt>chris@cwinters.comE<gt>
76  
77  
78 =cut
79  
80  
81 1 ▶sub OI2_DAEMONINI {
Subroutine OI2_DAEMONINI: called CC=1 SCAR=0.0
Pod undocumented
82 1 return <<'SOMELONGSTRING';
83 # The server name is for reporting purposes only
84 [server]
85 name = www.mycompany.com
86  
87 # All options here passed directly to IO::Socket::INET
88 [socket]
89 LocalAddr = localhost
90 LocalPort = 8080
91 Proto = tcp
92  
93 # Declare any number of regular expressions that tell the daemon to
94 # serve up the file directly from the /html tree rather than pass it
95 # to OI2
96 [content]
97 static_path = ^/images
98 static_path = \.(css|pdf|gz|zip|jpg|gif|png|mp3|mpg|mpeg|avi|mov)$
99 SOMELONGSTRING
100 }
101  
« OpenInteract2/Manage/Website/CreateSecurityForAction.pm ↑ Summary OpenInteract2/Brick/Messages.pm »