App-FastishCGI

 view release on metacpan or  search on metacpan

bin/fastishcgi  view on Meta::CPAN

use warnings;

use Getopt::Long qw/:config no_ignore_case bundling/;
use App::FastishCGI;
use Pod::Usage;

my $opt = {
    port   => 4001,
    ip     => '127.0.0.1',
    debug  => 0,
    stderr => 0,
    timeout => 10,
};

sub get_options {

    # TODO ipv6
    GetOptions( $opt, 'help|h', 'longhelp', 'ip=s', 'port|p=i', 'socket|s=s', 'css=s', 'debug|D!', 'stderr!', )
        or pod2usage();

    pod2usage(2) if $opt->{help};
    pod2usage(1) if $opt->{options};
    
}

get_options();

my $app = App::FastishCGI->new($opt);

bin/fastishcgi  view on Meta::CPAN

=head1 NAME

fastishcgi - run CGI scripts through a FastCGI interface

=head1 VERSION

version 0.002

=head1 SYNOPSIS

fastishcgi [help] [longhelp] [ip] [port] [socket] [css] [debug] [stderr]

=head1 OPTIONS

=over 8

=item B<--help|-h>

Basic help message

=item B<--longhelp>

bin/fastishcgi  view on Meta::CPAN


=item B<--css> <path>

Path to a stylesheet for error pages as it will be passed to the web server
e.g. "http://myserver/error.css" or just "/error.css"

=item B<--debug|-D>

Debugging messages will be enabled and outputted on STDERR

=item B<--stderr>

By default, errors are sent to syslog only. This flag also copies errors to stderr,
which usually gets logged by the webserver

=back

=head1 BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests through the web interface at
L<https://github.com/ioanrogers/App-FastishCGI/issues>.

lib/App/FastishCGI.pm  view on Meta::CPAN


    $self->{sigint} =
      AnyEvent->signal( signal => "INT", cb => sub { $self->shutdown_signal('INT') } );
    $self->{sigterm} =
      AnyEvent->signal( signal => "TERM", cb => sub { $self->shutdown_signal('TERM') } );
}

sub log_error {
    my ( $self, $err_str, $req ) = @_;

    if ( $self->{stderr} && defined $req ) {
        $req->print_stderr($err_str);
    }

    syslog( 'err', $err_str );
    return;
}

sub log_info {
    syslog( 'info', $_[1] );
    return;
}



( run in 0.681 second using v1.01-cache-2.11-cpan-26ccb49234f )