Re: Pushing OutputHandler using PerlFixupHandler

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

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

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

[...]

Stas Bekman wrote:

|
| I suppose it'd be nice to mention those in
| http://perl.apache.org/docs/2.0/user/handlers/filters.html
| patches are welcome :)
|

[...]

Here's a proposed patch for the docs. I didn't manage to create diff
using the svn diff -u. Is this command apropiate for svn? My client
tells me that -u means update and is not accepted by subcommand diff. Is
this an error in the docs?

http://perl.apache.org/download/docs.html#Submitting_documentation_patches

Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCQApDkVPeOFLgZFIRAqyiAKCb5ZkSqYl6p2YVVeAYXEG443pQeQCeLEQG
jvzjtMnHU4KSoVqtp79Stsw=
=rG7B
-----END PGP SIGNATURE-----

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

Index: src/docs/2.0/api/Apache/RequestUtil.pod
===================================================================
--- src/docs/2.0/api/Apache/RequestUtil.pod	(Revision 158584)
+++ src/docs/2.0/api/Apache/RequestUtil.pod	(Arbeitskopie)
@@ -890,6 +890,11 @@
   $ok = $r->push_handlers($hook_name => \&handler);
   $ok = $r->push_handlers($hook_name => ['Foo::Bar::handler', \&handler2]);
 
+Please note: To push input/output filters you have to use 
+C<L<Apache::Filter|docs::2.0::api::Apache::Filter>> methods 
+C<Apache::Filter-E<gt>add_input_filter($callback)> and
+C<Apache::Filter-E<gt>add_output_filter($callback)>.
+
 =over 4
 
 =item obj: C<$r>
Index: src/docs/2.0/user/handlers/filters.pod
===================================================================
--- src/docs/2.0/user/handlers/filters.pod	(Revision 158584)
+++ src/docs/2.0/user/handlers/filters.pod	(Arbeitskopie)
@@ -909,9 +909,29 @@
 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:
 
+  package MyApache::AddFilterDyn;
+  
+  use Apache::RequestRec;
+  use Apache::Const qw(:common);
+  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

--------------000001060809030007020903--

(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 12:06 on 22 Mar 2005

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