X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FHelper%2FSCGI.pm;fp=lib%2FCatalyst%2FHelper%2FSCGI.pm;h=31f0041fc205c162b9916554d28e46208c987c08;hb=628f14409b88d2edf9ff1a2fa2980b2260b538b8;hp=0000000000000000000000000000000000000000;hpb=ae3ccfd212efba601a23490845a6c6f21b5a5a72;p=catagits%2FCatalyst-Engine-SCGI.git diff --git a/lib/Catalyst/Helper/SCGI.pm b/lib/Catalyst/Helper/SCGI.pm new file mode 100755 index 0000000..31f0041 --- /dev/null +++ b/lib/Catalyst/Helper/SCGI.pm @@ -0,0 +1,124 @@ +package Catalyst::Helper::SCGI; + +use warnings; +use strict; +use Config; +use File::Spec; + +=head1 NAME + +Catalyst::Helper::SCGI - SCGI helper to create a scgi runner script to run the SCGI engine. + +=cut + +=head1 SYNOPSIS + +use the helper to build the view module and associated templates. + + $ script/myapp_create.pl SCGI -p 9000 + +=head1 DESCRIPTION + +This helper module creates the runner script for the SCGI engine. + +=cut + +=head2 $self->mk_stuff ( $c, $helper, @args ) + + Create SCGI runner script + +=cut + +sub mk_stuff { + my ( $self, $helper, @args ) = @_; + + my $base = $helper->{base}; + my $app = $helper->{app}; + + $helper->render_file( "scgi_script", + File::Spec->catfile( $base, 'script', "$app\_scgi.pl" ) ); + chmod 0700, "$base/script/$app\_scgi.pl"; +} + +=head1 AUTHOR + +Victor Igumnov, C<< >> + +=head1 BUGS + +Please report any bugs or feature requests to +C + +=head1 ACKNOWLEDGEMENTS + +=head1 COPYRIGHT & LICENSE + +Copyright 2006 Victor Igumnov, all rights reserved. + +This program is free software; you can redistribute it and/or modify it +under the same terms as Perl itself. + +=cut + +1; + +__DATA__ + +__scgi_script__ +#!/usr/bin/env perl + +BEGIN { $ENV{CATALYST_ENGINE} ||= 'SCGI' } + +use strict; +use warnings; +use Getopt::Long; +use Pod::Usage; +use FindBin; +use lib "$FindBin::Bin/../lib"; +use [% app %]; + +my $help = 0; +my ( $port, $detach ); + +GetOptions( + 'help|?' => \$help, + 'port|p=s' => \$port, + 'daemon|d' => \$detach, +); + +pod2usage(1) if $help; + +[% app %]->run( + $port, + $detach, +); + +1; + +=head1 NAME + +[% app %]_scgi.pl - Catalyst SCGI + +=head1 SYNOPSIS + +[% app %]_scgi.pl [options] + + Options: + -? -help display this help and exits + -p -port Port to listen on + -d -daemon daemonize + +=head1 DESCRIPTION + +Run a Catalyst application as SCGI. + +=head1 AUTHOR + +Victor Igumnov, C + +=head1 COPYRIGHT + +This library is free software, you can redistribute it and/or modify +it under the same terms as Perl itself. + +=cut