perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r158652 - perl/modperl/docs/trunk/src/docs/2.0/user/handlers/filters.pod
Date Tue, 22 Mar 2005 20:02:31 GMT
Author: stas
Date: Tue Mar 22 12:02:31 2005
New Revision: 158652

URL: http://svn.apache.org/viewcvs?view=rev&rev=158652
Log:
Adding OutFilters Dynamically
Contributed by: Tom Schindl <tomAtLinux@gmx.at>

Modified:
    perl/modperl/docs/trunk/src/docs/2.0/user/handlers/filters.pod

Modified: perl/modperl/docs/trunk/src/docs/2.0/user/handlers/filters.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/user/handlers/filters.pod?view=diff&r1=158651&r2=158652
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/user/handlers/filters.pod (original)
+++ perl/modperl/docs/trunk/src/docs/2.0/user/handlers/filters.pod Tue Mar 22 12:02:31 2005
@@ -911,6 +911,46 @@
 
 
 
+=head2 Adding OutFilters Dynamically
+
+If you have the need to add output filters dymically during the
+request, mod_perl 2.0 offers you the possibility to push filter
+callbacks at request time. For example here is how to add an output
+filter during the Fixup phase:
+
+  <Files *\.html >
+    PerlFixupHandler MyApache::AddFilterDyn
+  </Files>
+
+And the corresponding module:
+
+  #file:MyApache/AddFilterDyn.pm
+  package MyApache::AddFilterDyn;
+  
+  use Apache::Const -compile => qw(OK);
+  use Apache::Filter;
+  use MyApache::FilterObfuscate;
+  
+  sub handler {
+      my $r = shift;
+  
+      $r->add_output_filter(\&MyApache::FilterObfuscate::handler);
+  
+      return Apache::OK;
+  }
+  
+  1;
+
+You can also add connection filters dynamically. For more information
+referer to the C<L<Apache::Filter|docs::2.0::api::Apache::Filter>>
+manpage:
+C<L<add_input_filter|docs::2.0::api::Apache::Filter/C_add_input_filter_>>
+and
+C<L<add_output_filter|docs::2.0::api::Apache::Filter/C_add_output_filter_>>.
+
+
+
+
 
 =head2 HTTP Request vs. Connection Filters
 



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Mime
View raw message