Re: Pushing OutputHandler using PerlFixupHandler

[prev] [thread] [next] [Date index for 2005/03/22]

From: Tom Schindl
Subject: Re: Pushing OutputHandler using PerlFixupHandler
Date: 18:41 on 22 Mar 2005
This is a multi-part message in MIME format.
--------------080805040102080506070900
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

and now without a typo :-(
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCQGbGkVPeOFLgZFIRAttrAJ9NsndbNWSgoDWCyxbSRbB7RnsFUgCghGh7
VNR3MxH4ksdK5nHH8KhzMnw=
=SsgX
-----END PGP SIGNATURE-----

--------------080805040102080506070900
Content-Type: text/x-patch;
 name="filter.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="filter.patch"

Index: src/docs/2.0/user/handlers/filters.pod
===================================================================
--- src/docs/2.0/user/handlers/filters.pod	(Revision 158635)
+++ src/docs/2.0/user/handlers/filters.pod	(Arbeitskopie)
@@ -909,9 +909,35 @@
 C<L<DIR|docs::2.0::user::config::config/item_DIR>>.
 
 
+=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 during 
+the request is processed. If want for example add an outfilter during the
+Fixup-Phase your config would look the following:
 
+  <Files *\.html >
+    PerlFixupHandler MyApache::AddFilterDyn 
+  </Files>
 
+And your module could look like this:
+
+  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;
+
 =head2 HTTP Request vs. Connection Filters
 
 mod_perl 2.0 supports connection and HTTP request filtering. mod_perl

--------------080805040102080506070900--

(message missing)

Pushing OutputHandler using PerlFixupHandler
Thomas Schindl 12:08 on 21 Mar 2005

Re: Pushing OutputHandler using PerlFixupHandler
Geoffrey Young 12:47 on 21 Mar 2005

Re: Pushing OutputHandler using PerlFixupHandler
Tom Schindl 18:41 on 22 Mar 2005

Generated at 15:10 on 27 Mar 2005 by mariachi v0.52