Apache2-SSI
view release on metacpan or search on metacpan
# To enable trunk mode:
# PerlSetVar Apache2_SSI_Expression "trunk"
</Directory>
VERSION
v0.2.0
DESCRIPTION
Apache2::SSI implements Apache Server Side Include
<https://httpd.apache.org/docs/current/en/howto/ssi.html>, a.k.a. SSI,
within and outside of Apache2/mod_perl2 framework.
Apache2::SSI is inspired from the original work of Apache::SSI with the
main difference that Apache2::SSI works well when called from within
Apache mod_perl2 as well as when called outside of Apache if you want to
simulate SSI <https://httpd.apache.org/docs/current/en/howto/ssi.html>.
Apache2::SSI also implements all of Apache SSI features, including
functions, encoding and decoding and old style variables such as
"${QUERY_STRING}" as well as modern style such as "v('QUERY_STRING')"
and variants such as "%{REQUEST_URI}".
<!--#if expr="resp('X-ProcessId') == '$$'" -->
This worked!
<!--#else -->
Nope, it failed.
<!--#endif -->
An important note here:
First, there is obviously no response header available for perl scripts
running outside of Apache2/mod_perl2 framework.
If the script runs under mod_perl, not all response header will be
available depending on whether you are using Apache2::SSI in your Apache
configuration as an output filter handler ("PerlOutputFilterHandler") or
a response handler ("PerlResponseHandler").
If it is running as an output filter handler, then some headers, such as
"Content-Type" will not be available, unless they have been set by a
script in a previous phase. Only basic headers will be available. For
more information, check the Apache/mod_perl2 documentation on each
=======
v0.2.0
DESCRIPTION
===========
[Apache2::SSI](https://metacpan.org/pod/Apache2::SSI){.perl-module}
implements [Apache Server Side
Include](https://httpd.apache.org/docs/current/en/howto/ssi.html){.perl-module},
a.k.a. SSI, within and outside of Apache2/mod\_perl2 framework.
[Apache2::SSI](https://metacpan.org/pod/Apache2::SSI){.perl-module} is
inspired from the original work of
[Apache::SSI](https://metacpan.org/pod/Apache::SSI){.perl-module} with
the main difference that
[Apache2::SSI](https://metacpan.org/pod/Apache2::SSI){.perl-module}
works well when called from within Apache mod\_perl2 as well as when
called outside of Apache if you want to simulate
[SSI](https://httpd.apache.org/docs/current/en/howto/ssi.html){.perl-module}.
<!--#if expr="resp('X-ProcessId') == '$$'" -->
This worked!
<!--#else -->
Nope, it failed.
<!--#endif -->
An important note here:
First, there is obviously no response header available for perl scripts
running outside of Apache2/mod\_perl2 framework.
If the script runs under mod\_perl, not all response header will be
available depending on whether you are using
[Apache2::SSI](https://metacpan.org/pod/Apache2::SSI){.perl-module} in
your Apache configuration as an output filter handler
(`PerlOutputFilterHandler`) or a response handler
(`PerlResponseHandler`).
If it is running as an output filter handler, then some headers, such as
`Content-Type` will not be available, unless they have been set by a
lib/Apache2/SSI.pm view on Meta::CPAN
document_root => $self->document_root,
base_uri => $self->uri,
debug => $self->debug,
};
$p->{apache_request} = $self->apache_request if( $self->apache_request );
my $o = Apache2::SSI::URI->new( $p ) ||
return( $self->error( "Unable to create an Apache2::SSI::URI: ", Apache2::SSI::URI->error ) );
return( $o );
}
# This makes use of Apache2::SSI::Notes which guarantees that notes are shared in and out of Apache framework
# Notes are cleaned up at server shutdown with an handler set in startup.pl
# See scripts/startup.pl and conf/extra.conf.in as an example
sub notes
{
my $self = shift( @_ );
my $notes = $self->{notes};
my $r = $self->apache_request;
unless( scalar( @_ ) )
{
if( $r )
lib/Apache2/SSI.pm view on Meta::CPAN
# To enable trunk mode:
# PerlSetVar Apache2_SSI_Expression "trunk"
</Directory>
=head1 VERSION
v0.2.0
=head1 DESCRIPTION
L<Apache2::SSI> implements L<Apache Server Side Include|https://httpd.apache.org/docs/current/en/howto/ssi.html>, a.k.a. SSI, within and outside of Apache2/mod_perl2 framework.
L<Apache2::SSI> is inspired from the original work of L<Apache::SSI> with the main difference that L<Apache2::SSI> works well when called from within Apache mod_perl2 as well as when called outside of Apache if you want to simulate L<SSI|https://http...
L<Apache2::SSI> also implements all of Apache SSI features, including functions, encoding and decoding and old style variables such as C<${QUERY_STRING}> as well as modern style such as C<v('QUERY_STRING')> and variants such as C<%{REQUEST_URI}>.
See below details in this documentation and in the section on L</"SSI Directives">
Under Apache mod_perl, you would implement it like this in your C<apache2.conf> or C<httpd.conf>
<Files *.phtml>
lib/Apache2/SSI.pm view on Meta::CPAN
Example:
<!--#if expr="resp('X-ProcessId') == '$$'" -->
This worked!
<!--#else -->
Nope, it failed.
<!--#endif -->
An important note here:
First, there is obviously no response header available for perl scripts running outside of Apache2/mod_perl2 framework.
If the script runs under mod_perl, not all response header will be available depending on whether you are using L<Apache2::SSI> in your Apache configuration as an output filter handler (C<PerlOutputFilterHandler>) or a response handler (C<PerlRespons...
If it is running as an output filter handler, then some headers, such as C<Content-Type> will not be available, unless they have been set by a script in a previous phase. Only basic headers will be available. For more information, check the Apache/mo...
=head2 parse_func_sha1
Hash the string using SHA1, then encode the hash with hexadecimal encoding.
Example:
lib/Apache2/SSI/Notes.pm view on Meta::CPAN
The interface is loosely mimicking L<APR::Table> on some, but not all, methods.
So you could have in your script, outside of Apache:
$notes->set( API_ID => 1234567 );
And then, under mod_perl, in your file:
<!--#if expr="note('API_ID')" -->
Normally, the C<note> function would work only for values set and retrieved inside the Apache/mod_perl2 framework, but with L<Apache2::SSI::Notes>, you can set a note, say, in a command line script and share it with your Server-Side Includes files.
To achieve this sharing of notes, L<Apache2::SSI::Notes> uses shared memory (see L<perlipc>) with L<Apache2::SSI::SharedMem> that does the heavy work.
However, this only works when L<Apache2::SSI> is in charge of parsing SSI files. Apache mod_includes module will not recognise notes stored outside of Apache/mod_perl framework.
=head1 METHODS
=head2 new
This instantiates a notes object. It takes the following parameters:
=over 4
=item C<debug>
( run in 1.038 second using v1.01-cache-2.11-cpan-df04353d9ac )