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