I need to be able to at least temporarily change the document_root on the
fly. Something like the following:
$r->document_root("/my/hacked/path");
But it crashes with a prototype mismatch. The docs say:
$r->document_root:cannot currently be modified. requires locking since it
is part ofthe per-server config structure which is shared between threads
Well, I could care less about actually modifying the server record. Isn't
there a way to point it to a temporary string just for the request?
In Apache1, it worked fine to copy the entire server record into a malloc
and hack the document_root setting in the copy and point the server record
pointer there just for the request. Then free this temporary server record.
Or in mod_perl, just set the document_root to the real path just long enough
for the Translation phase and then fix it back to the original value in the
Cleanup phase.
What do you recommend in order to accomplish this under mod_perl 1.99 for
Apache 2.0?
- [mp2] What happened to $r->connection->remote_addr? Rob Brown