| 1 | |||
| 2 | =head1 NAME | ||
| 3 | |||
| 4 | Apache::SSIChain - do SSI on other modules' output | ||
| 5 | |||
| 6 | =cut | ||
| 7 | |||
| 8 | package Apache::SSIChain; | ||
| 9 | use Apache::SSI; | ||
| 10 | use Apache::OutputChain; | ||
| 11 | |||
| 12 | use vars qw( $VERSION @ISA ); | ||
| 13 | $VERSION = 0.07; | ||
| 14 | @ISA = qw( Apache::OutputChain ); | ||
| 15 | |||
| 16 | my $html_parser; | ||
| 17 | sub handler | ||
| 18 | { | ||
| 19 | my $r = shift; | ||
| 20 | $html_parser = new Apache::SSI('', $r); | ||
| 21 | Apache::OutputChain::handler($r, __PACKAGE__); | ||
| 22 | } | ||
| 23 | sub PRINT { | ||
| 24 | my $self = shift; | ||
| 25 | $html_parser->text(join '', @_); | ||
| 26 | $self->Apache::OutputChain::PRINT($html_parser->get_output()); | ||
| 27 | } | ||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | =head1 SYNOPSIS | ||
| 32 | |||
| 33 | In the conf/access.conf file of your Apache installation add lines | ||
| 34 | like | ||
| 35 | |||
| 36 | <Files *.html> | ||
| 37 | SetHandler perl-script | ||
| 38 | PerlHandler Apache::OutputChain Apache::SSIChain Apache::PassHtml | ||
| 39 | </Files> | ||
| 40 | |||
| 41 | =head1 DESCRIPTION | ||
| 42 | |||
| 43 | This module uses B<Apache::SSI> and B<Apache::OutputChain> modules to | ||
| 44 | create a filtering module that takes output from other modules | ||
| 45 | (B<Apache::PassHtml>, B<Apache::PassExec>), parses SSI tags and sends | ||
| 46 | the result to Apache, or maybe to other module | ||
| 47 | (B<Apache::GzipChain> by Andreas Koenig): | ||
| 48 | |||
| 49 | <Files *.html> | ||
| 50 | SetHandler perl-script | ||
| 51 | PerlHandler Apache::OutputChain Apache::GzipChain Apache::SSIChain Apache::PassHtml | ||
| 52 | </Files> | ||
| 53 | |||
| 54 | Or you can do SSI on CGI's: | ||
| 55 | |||
| 56 | <Files *.cgi> | ||
| 57 | PerlSendHeader On | ||
| 58 | SetHandler perl-script | ||
| 59 | PerlHandler Apache::OutputChain Apache::SSIChain Apache::PassExec | ||
| 60 | Options ExecCGI | ||
| 61 | </Files> | ||
| 62 | |||
| 63 | or even on modules processed by Apache::Registry: | ||
| 64 | |||
| 65 | <Files *.pl> | ||
| 66 | PerlSendHeader On | ||
| 67 | SetHandler perl-script | ||
| 68 | PerlHandler Apache::OutputChain Apache::SSIChain Apache::Registry | ||
| 69 | Options ExecCGI | ||
| 70 | </Files> | ||
| 71 | |||
| 72 | =head1 VERSION | ||
| 73 | |||
| 74 | 0.07 | ||
| 75 | |||
| 76 | =head1 AUTHOR | ||
| 77 | |||
| 78 | (c) 1998--1999 Jan Pazdziora, adelton@fi.muni.cz, | ||
| 79 | http://www.fi.muni.cz/~adelton/ at Faculty of Informatics, Masaryk | ||
| 80 | University, Brno, Czech Republic | ||
| 81 | |||
| 82 | =head1 SEE ALSO | ||
| 83 | |||
| 84 | Apache::SSI(3); Apache::GzipChain(3); mod_perl(1); www.apache.org, | ||
| 85 | www.perl.com. | ||
| 86 | |||
| 87 | =cut | ||
| 88 |