You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Sam Carleton <sc...@miltonstreet.com> on 2007/12/03 22:24:47 UTC

Understanding how to write large application in apache modules

I am more interested in theory right now than anything else.
Currently my web development is 80% PHP and 20% Apache Module.  The
Apache module is currently a handler for my images and controls
security.

I have adopted a template type of approach with the PHP code, I found
this utility class that allows me to place 100% of my HTML into
"template" files and keep the PHP pure code.  I think the concept is
pretty standard:

The PHP code determines which templates to use to build the page.
Then the PHP sets all the variables for those pages.  And finally it
calls the utility class that actually builds the page replacing the
variables in the template with the values I set in the PHP.

The more I think about it, the more this sounds like what folks are
doing with input and output filter in Apache modules.  I am starting
to think that it is possible to develop a whole solution solely as an
Apache module and simply have it filter HTML template files filling in
"variables".  Is this how folks do it?

Sam

Re: Understanding how to write large application in apache modules

Posted by Nick Kew <ni...@webthing.com>.
On Mon, 3 Dec 2007 16:24:47 -0500
"Sam Carleton" <sc...@miltonstreet.com> wrote:

> I am more interested in theory right now than anything else.
> Currently my web development is 80% PHP and 20% Apache Module.  The
> Apache module is currently a handler for my images and controls
> security.

That looks like a valid approach.

> The more I think about it, the more this sounds like what folks are
> doing with input and output filter in Apache modules.  I am starting
> to think that it is possible to develop a whole solution solely as an
> Apache module and simply have it filter HTML template files filling in
> "variables".  Is this how folks do it?

That's a valid approach too, mod_publisher or the XMLNS framework
being examples.

If you feel the urge to change what you've got, I'd start by breaking
down your problem into subtasks.  Then identify good candidates for
implementing as a module, and go ahead and do it.

Your position may be akin to what mine was when I first made apache
modules a core part of my work.  I started by converting input
(form decoding/file upload) and output (XSLT) to filter modules,
then converted some but not all of the applications in the middle.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/