unfucked test server options and made test pass f'real this time
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Script / FastCGI.pm
1 package Catalyst::Script::FastCGI;
2
3 BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
4 use Moose;
5 use MooseX::Types::Moose qw/Str Bool Int/;
6 use namespace::autoclean;
7
8 with 'Catalyst::ScriptRole';
9
10 has listen => (
11     traits => [qw(Getopt)],
12     cmd_aliases => 'l',
13     isa => Int,
14     is => 'ro',
15     documentation => 'Specify a listening port/socket',
16 );
17
18 has pidfile => (
19     traits => [qw(Getopt)],
20     cmd_aliases => 'pid',
21     isa => Str,
22     is => 'ro',
23     documentation => 'Specify a pidfile',
24 );
25
26 has daemon => (
27     traits => [qw(Getopt)],
28     isa => Bool,   
29     is => 'ro', 
30     cmd_aliases => 'd', 
31     documentation => 'Daemonize',
32 );
33
34 has manager => (
35     traits => [qw(Getopt)],
36     isa => Str,    
37     is => 'ro',
38     cmd_aliases => 'm',
39     documentation => 'Use a different FastCGI manager', # FIXME
40 );
41
42 has keep_stderr => (
43     traits => [qw(Getopt)],
44     cmd_aliases => 'std', 
45     isa => Bool,   
46     is => 'ro',  
47     documentation => 'Log STDERR',
48 );
49
50 has nproc => (
51     traits => [qw(Getopt)],
52     cmd_aliases => 'np',  
53     isa => Int,
54     is => 'ro',  
55     documentation => 'Specify an nproc', # FIXME
56 );
57
58 has detach => (
59     traits => [qw(Getopt)],
60     cmd_aliases => 'det', 
61     isa => Bool,   
62     is => 'ro',  
63     documentation => 'Detach this FastCGI process',
64 );
65
66 sub _application_args {
67     my ($self) = shift;
68     return (
69         $self->listen,
70         {
71             nproc   => $self->nproc,
72             pidfile => $self->pidfile,
73             manager => $self->manager,
74             detach  => $self->detach,
75             keep_stderr => $self->keep_stderr,
76         }
77     );
78 }
79
80 __PACKAGE__->meta->make_immutable;
81
82 =head1 NAME
83
84 Catalyst::Script::FastCGI - The FastCGI Catalyst Script
85
86 =head1 SYNOPSIS
87
88 See L<Catalyst>.
89
90 =head1 DESCRIPTION
91
92 FIXME
93
94 =head1 AUTHORS
95
96 Catalyst Contributors, see Catalyst.pm
97
98 =head1 COPYRIGHT
99
100 This library is free software. You can redistribute it and/or modify it under
101 the same terms as Perl itself.
102
103 =cut