Apache::SSI is a module to implement Server Side Includes in Perl.
SYNOPSIS
In httpd.conf:
< Files *.phtml > # or whatever
SetHandler perl-script
PerlHandler Apache::SSI
< /Files >
You may wish to subclass Apache::SSI for your own extensions. If so, compile mod_perl with PERL_METHOD_HANDLERS=1 (so you can use object-oriented inheritance), and create a module like this:
package MySSI;
use Apache::SSI ();
@ISA = qw(Apache::SSI);
#embedded syntax:
#
sub ssi_something {
my($self, $attr) = @_;
my $cmd = $attr->{param};
...
return $a_string;
}
Then in httpd.conf:
< Files *.phtml >
SetHandler perl-script
PerlHandler MySSI
< /Files >
Apache::SSI implements the functionality of mod_include for handling server-parsed html documents. It runs under Apache's mod_perl.
In my mind, there are two main reasons you might want to use this module: you can sub-class it to implement your own custom SSI directives, and/or you can parse the output of other mod_perl handlers, or send the SSI output through another handler (use Apache::Filter to do this).
Each SSI directive is handled by an Apache::SSI method with the prefix "ssi_". For example, < !--#printenv-- > is handled by the ssi_printenv method. attribute=value pairs inside the SSI tags are parsed and passed to the method in a hash reference.
'Echo' directives are handled by the ssi_echo method, which delegates lookup to methods with the prefix "echo_". For instance, < !--#echo var=DOCUMENT_NAME-- > is handled by the echo_DOCUMENT_NAME method.
You can customize behavior by inheriting from Apache::SSI and overriding 'ssi_*' and 'echo_*' methods, or writing new ones.
Product's homepage
Requirements:
· Perl