Catalyst::Helper::SCGI - SCGI helper to create a scgi runner script to run the SCGI engine.


Catalyst-Engine-SCGI documentation Contained in the Catalyst-Engine-SCGI distribution.

Index


Code Index:

NAME

Top

Catalyst::Helper::SCGI - SCGI helper to create a scgi runner script to run the SCGI engine.

SYNOPSIS

Top

use the helper to build the view module and associated templates.

	$ script/myapp_create.pl SCGI

DESCRIPTION

Top

This helper module creates the runner script for the SCGI engine.

$self->mk_stuff ( $c, $helper, @args )

	Create SCGI runner script

AUTHOR

Top

Orlando Vazquez, <orlando at 2wycked.net >

BUGS

Top

Please report any bugs or feature requests to orlando at 2wycked.net

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top

NAME

Top

[% app %]_scgi.pl - Catalyst SCGI

SYNOPSIS

Top

[% app %]_scgi.pl [options]

 Options:
   -? -help     display this help and exits
   -p -port    	Port to listen on
   -d -daemon   daemonize

DESCRIPTION

Top

Run a Catalyst application as SCGI.

AUTHOR

Top

Orlando Vazquez orlando@2wycked.net

COPYRIGHT

Top


Catalyst-Engine-SCGI documentation Contained in the Catalyst-Engine-SCGI distribution.
package Catalyst::Helper::SCGI;

use warnings;
use strict;
use Config;
use File::Spec;

our $VERSION = '0.03';

sub mk_stuff {
    my ( $self, $helper, @args ) = @_;

    my $base = $helper->{base};
    my $app  = lc($helper->{app});

    $helper->render_file( "scgi_script",
        File::Spec->catfile( $base, 'script', "$app\_scgi.pl" ) );
    chmod 0700, "$base/script/$app\_scgi.pl";
}

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;