NAME

Apache::Taco.pm - mod_perl handler for Taco

SYNOPSIS

This module defines a mod_perl handler (running under the Apache web server) that serves Taco pages.

# In Apache's srm.conf (or similar), setup so
# files ending in .taco get handled by Apache::Taco
<Files ~ "\.taco$">
 SetHandler perl-script
 PerlHandler Apache::Taco
 PerlSetVar TacoRelayHost whatever.you.want/no_taco  # for SSI
</Files>

DESCRIPTION

This module lets you serve Taco files over the World Wide Web. It lets you write Taco modules that take advantage of mod_perl's speed and power.

PerlSetVar parameters

When this handler runs, it takes several different parameters that can alter its behavior. To set any of these parameters, use the PerlSetVar command in an appropriate Apache config file. This may be any of httpd.conf, srm.conf, etc., or a .htaccess file:

PerlSetVar TacoService joes_cars

See the mod_perl documentation for more information about PerlSetVar.

  • TacoService <service name>

    Use this to set the service that a request will run under. See Taco::ServiceRegistry.pm for more information about services.

  • TacoCGI <true or false>

    If set to true, Taco will interpret the file as Perl code. The Perl code will have access to all of Taco's internal functions.

  • TacoRelayHost < URL prefix >

    By default, Apache::Taco will just read in the file pointed to by the URL and interpret it as a Taco template. This prevents server-side includes, however. If you want to use server-side includes, you should use either the TacoRelayHost parameter or the TacoFilterMod parameter.

    If your server is configured with the following:

    PerlSetVar TacoRelayHost http://whatever.host.edu/no_taco

    and Apache::Taco gets a request at http://taco.host.edu/page.taco, it will request the URL http://whatever.host.edu/no_taco/page.taco, and then interpret the content of that page as a Taco template.

  • TacoFilterMod < Perl module (class) >

    If you'd rather implement SSI (or any other text processing) yourself in a Perl module, you can use the TacoFilterMod parameter:

    PerlSetVar TacoFilterMod  MyPackage::filter

    The MyPackage::filter class needs to define a new() method and an output() method, because it will be called like this:

    # Pass the filename and the current Apache::Request object
    my $p = MyPackage::filter->new($filename, $G::r); 
    $template->set_text( $p->output );
    $template->output($buffer);

    It's possible that the TacoFilterMod capability can be better implemented by using an Apache::OutputChain, but I don't know much about that yet.

  • TacoDebug <true or false>

    When this parameter is set to 'true', Apache::Taco will print a few debug statements to Apache's error log.

SEE ALSO

Taco(3), Apache(3), mod_perl(1), and the mod_perl web site at http://perl.apache.org/

AUTHOR

Ken Williams (ken@forum.swarthmore.edu)

Copyright (c) 1998 Swarthmore College. All rights reserved.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 213:

You forgot a '=back' before '=head1'