fix a documation bug
[catagits/Catalyst-Engine-SCGI.git] / lib / Catalyst / Helper / SCGI.pm
CommitLineData
628f1440 1package Catalyst::Helper::SCGI;
2
3use warnings;
4use strict;
5use Config;
6use File::Spec;
7
74b7d482 8our $VERSION = '0.02';
9
628f1440 10=head1 NAME
11
12Catalyst::Helper::SCGI - SCGI helper to create a scgi runner script to run the SCGI engine.
13
14=cut
15
16=head1 SYNOPSIS
17
18use the helper to build the view module and associated templates.
19
a9251dc3 20 $ script/myapp_create.pl SCGI
628f1440 21
22=head1 DESCRIPTION
23
24This helper module creates the runner script for the SCGI engine.
25
26=cut
27
28=head2 $self->mk_stuff ( $c, $helper, @args )
29
30 Create SCGI runner script
31
32=cut
33
34sub mk_stuff {
35 my ( $self, $helper, @args ) = @_;
36
37 my $base = $helper->{base};
29f460bf 38 my $app = lc($helper->{app});
628f1440 39
40 $helper->render_file( "scgi_script",
41 File::Spec->catfile( $base, 'script', "$app\_scgi.pl" ) );
42 chmod 0700, "$base/script/$app\_scgi.pl";
43}
44
45=head1 AUTHOR
46
9ca6d100 47Orlando Vazquez, C< <orlando at 2wycked.net> >
628f1440 48
49=head1 BUGS
50
51Please report any bugs or feature requests to
9ca6d100 52C<orlando at 2wycked.net>
628f1440 53
54=head1 ACKNOWLEDGEMENTS
55
56=head1 COPYRIGHT & LICENSE
57
9ca6d100 58Copyright 2009 Orlando Vazquez, all rights reserved.
628f1440 59Copyright 2006 Victor Igumnov, all rights reserved.
60
61This program is free software; you can redistribute it and/or modify it
62under the same terms as Perl itself.
63
64=cut
65
661;
67
68__DATA__
69
70__scgi_script__
71#!/usr/bin/env perl
72
73BEGIN { $ENV{CATALYST_ENGINE} ||= 'SCGI' }
74
75use strict;
76use warnings;
77use Getopt::Long;
78use Pod::Usage;
79use FindBin;
80use lib "$FindBin::Bin/../lib";
81use [% app %];
82
83my $help = 0;
84my ( $port, $detach );
85
86GetOptions(
87 'help|?' => \$help,
88 'port|p=s' => \$port,
89 'daemon|d' => \$detach,
90);
91
92pod2usage(1) if $help;
93
94[% app %]->run(
95 $port,
96 $detach,
97);
98
991;
100
101=head1 NAME
102
103[% app %]_scgi.pl - Catalyst SCGI
104
105=head1 SYNOPSIS
106
107[% app %]_scgi.pl [options]
108
109 Options:
110 -? -help display this help and exits
111 -p -port Port to listen on
112 -d -daemon daemonize
113
114=head1 DESCRIPTION
115
116Run a Catalyst application as SCGI.
117
118=head1 AUTHOR
119
9ca6d100 120Orlando Vazquez C<< orlando@2wycked.net >>
628f1440 121
122=head1 COPYRIGHT
123
124This library is free software, you can redistribute it and/or modify
125it under the same terms as Perl itself.
126
127=cut