added synopsis to Engine subclassed and documented a couple of methods to make podcov...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / CGI / NPH.pm
CommitLineData
e646f111 1package Catalyst::Engine::CGI::NPH;
2
3use strict;
4use base 'Catalyst::Engine::CGI';
5
c038f8ff 6use HTTP::Status ();
7
e646f111 8=head1 NAME
9
10Catalyst::Engine::CGI::NPH - Catalyst CGI Engine
11
12=head1 SYNOPSIS
13
c9afa5fc 14A script using the Catalyst::Engine::CGI::NPH module might look like:
15
16 #!/usr/bin/perl -w
17
18 BEGIN {
19 $ENV{CATALYST_ENGINE} = 'CGI::NPH';
20 }
21
22 use strict;
23 use lib '/path/to/MyApp/lib';
24 use MyApp;
25
26 MyApp->run;
e646f111 27
28=head1 DESCRIPTION
29
30This Catalyst engine returns a complete HTTP response message.
31
32=head1 OVERLOADED METHODS
33
34This class overloads some methods from C<Catalyst::Engine::CGI>.
35
36=over 4
37
38=item $c->finalize_headers
39
40=cut
41
42sub finalize_headers {
43 my $c = shift;
c038f8ff 44
cfc303c8 45 my $protocol = $ENV{SERVER_PROTOCOL} || 'HTTP/1.0';
46 my $status = $c->response->status || 200;
47 my $message = HTTP::Status::status_message($status);
48
49 printf( "%s %d %s\015\012", $protocol, $status, $message );
50
c038f8ff 51 $c->SUPER::finalize_headers;
e646f111 52}
53
54=back
55
56=head1 SEE ALSO
57
58L<Catalyst>, L<Catalyst::Engine::CGI>.
59
60=head1 AUTHOR
61
62Sebastian Riedel, C<sri@cpan.org>
63Christian Hansen, C<ch@ngmedia.com>
64
65=head1 COPYRIGHT
66
67This program is free software, you can redistribute it and/or modify it under
68the same terms as Perl itself.
69
70=cut
71
721;