Joshua Slive wrote:
> On 8/19/07, Per Jessen <[EMAIL PROTECTED]> wrote:
>> I've been re-reading the manual to try to gain a better understanding of
>> filters and handlers, specifically the difference between the two.
>>
>> The reason being -
>>
>> by default, the PHP interpreter is called as a handler (a typical
>> config: "AddHandler application/x-httpd-php .phtml".  By implementation
>> INCLUDES is a filter which is enabled using e.g.
>> "AddOutputFilter INCLUDES shtml".
>>
>> I'd like to have my files processed first by the INCLUDES filter, then
>> by the PHP handler.  The "AddOutputFilter" option clearly supports this
>> type of sequence.
>>
>> But back to my initial question - what is the functional difference
>> between a handler and a filter?
> 
> Handlers must originate the content themselves, whereas filters can
> deal with content passed down from someplace else.
> 
> PHP is only a handler, due to zend's requirement that it deal with the
> php file on disk and not in memory. (This was the argument at the
> time, anyway. I'm not sure if things in php land have evolved since
> that decision was made.) Therefore PHP must originate the content and
> can't act on content passed from someplace else like mod_include.

Substantially.  Thanks to John and I, and improvements in the Zend2
engine, it's quite a respectable filter now.

People are simply used to treating php as a handler.

That said; there can be only 1:1 handler for a request.  You can stack
many filters on top of that.

It's trivial to make a handler that is essentially printf("hello world!");

It's another thing to make a filter that decorates whatever comes up from
the core handler (e.g. "hello world!") and decorate it by processing it
in a scripting language or transforming it (e.g. into "<p>hello world!</p>"
or "HELLO WORLD!").

In a perfect world, there will be only a handful of handlers soon, such
as a filesystem handler, a database content record handler, etc.  Almost
everything else add-in modules do can be described as filtering, and once
they are a proper filter, things are much more pluggable.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to