since the prepare_path behaviour has changed, juice the "version" up
[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
20 $ script/myapp_create.pl SCGI -p 9000
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
47Victor Igumnov, C<< <victori at lamer0.com> >>
48
49=head1 BUGS
50
51Please report any bugs or feature requests to
52C<victori at cpan.org>
53
54=head1 ACKNOWLEDGEMENTS
55
56=head1 COPYRIGHT & LICENSE
57
58Copyright 2006 Victor Igumnov, all rights reserved.
59
60This program is free software; you can redistribute it and/or modify it
61under the same terms as Perl itself.
62
63=cut
64
651;
66
67__DATA__
68
69__scgi_script__
70#!/usr/bin/env perl
71
72BEGIN { $ENV{CATALYST_ENGINE} ||= 'SCGI' }
73
74use strict;
75use warnings;
76use Getopt::Long;
77use Pod::Usage;
78use FindBin;
79use lib "$FindBin::Bin/../lib";
80use [% app %];
81
82my $help = 0;
83my ( $port, $detach );
84
85GetOptions(
86 'help|?' => \$help,
87 'port|p=s' => \$port,
88 'daemon|d' => \$detach,
89);
90
91pod2usage(1) if $help;
92
93[% app %]->run(
94 $port,
95 $detach,
96);
97
981;
99
100=head1 NAME
101
102[% app %]_scgi.pl - Catalyst SCGI
103
104=head1 SYNOPSIS
105
106[% app %]_scgi.pl [options]
107
108 Options:
109 -? -help display this help and exits
110 -p -port Port to listen on
111 -d -daemon daemonize
112
113=head1 DESCRIPTION
114
115Run a Catalyst application as SCGI.
116
117=head1 AUTHOR
118
119Victor Igumnov, C<victori@cpan.org>
120
121=head1 COPYRIGHT
122
123This library is free software, you can redistribute it and/or modify
124it under the same terms as Perl itself.
125
126=cut