Peter J. Schoenster wrote:

> Using mod_perl I can write a module for any phase that Apache 
> goes through while handling a request. Based upon any variables I 
> want, I can tell Apache to have my module handle one of those 
> phases. So when you request this url for example:
> My module can take joe.html and insert it as the body of a 
> template and then return that to your browser or if you request 
> something else like 
> then my module just declines to handle that and apache continues 
> through it's phases.

No, mod_php can't do that - at least not at this current stage.  I 
*thought* I'd heard some rumblings of some of the PHP team looking to 
address the issue of allowing PHP more access to the Apache request 
cycle.  I think there's 7 stages, and PHP is only hooked in to one 
stage, IIRC.

Maybe it was Rasmus in a recent interview who suggested there might be 
tighter integration with Apache, I don't know.  Perhaps this is also 
something for Apache 2, down the road,

> Here is an example (bad execution of an example though)
> I have the following .htaccess file in that directory:
> SetHandler perl-script
> PerlHandler Apache::Schoenster_Gallery
> PerlSetVar DOCROOT /usr/local/etc/httpd/htdocs/images
> PerlSetVar URL_PATH /images
> I can stick this .htaccess file in any directory (only makes sense 
> where I have images) and it uses those 2 variables above to 
> determine where to read for images and where to write the files 
> which produces the frame-set that you see (the module looks in 
> that file for templates to parse so I can have different looks in 
> different places wihout changing the module). I say it's a bad 
> execution because I'm using imagemagick to resize (regardless of 
> original size). If I add new images it will automatically create a 
> thumbnail (which can currently be larger than the original :) of that. 
> I use a db file to cache thumbnails already created but it does 
> check file modification date to see if it should resize the image or 
> not.
> But what I want to do is to do this with html files where I'll have a 
> few templates (header,footer,navigation,boxes) that will be created 
> on the fly depending upon variables when a client requests an html 
> file and I want to know if I can do this in PHP without rewriting the 
> url  (which is not such a bad option perhaps).
> Peter

I think you'll have to use url rewriting for this.  Not as tight 
integration as mod_perl, but if you have to use it, that's probably your 
only option at this point.

Good luck!

Michael Kimsal
Taking the ? out of <?php

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to