--- sapi/apache/mod_php4.c.orig Sun Sep 16 17:49:55 2001 +++ sapi/apache/mod_php4.c Wed Jan 9 12:31:36 2002 @@ -483,6 +483,39 @@ } /* }}} */ +static int php_get_request_handler(request_rec *r, char **target) +{ + HashTable *per_dir_conf; + php_per_dir_entry *per_dir_entry; + char *filename; + + if (!(per_dir_conf = get_module_config(r->per_dir_config, &php4_module))) + return 0; + + if (zend_hash_find(per_dir_conf, "request_handler", sizeof("request_handler")-1, + (void **)&per_dir_entry) == SUCCESS) + { + if (!ap_os_is_path_absolute(per_dir_entry->value)) + { + char *dirnam = ap_pstrdup(r->pool, r->filename); + char *x = strrchr(dirnam, '/'); + + if (x != NULL) + *x = 0; + filename = ap_make_full_path(r->pool, dirnam, per_dir_entry->value); + } + else + filename = ap_pstrdup(r->pool, per_dir_entry->value); + + *target = filename; + return 1; + } + + return 0; +} + + + /* {{{ send_php */ static int send_php(request_rec *r, int display_source_mode, char *filename) @@ -501,6 +534,9 @@ zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh); return OK; } + + if (php_get_request_handler(r, &filename)) + r->filename = filename; zend_first_try { /* We don't accept OPTIONS requests, but take everything else */