#include "util_script.h"
#include "mod_php4.h"
-#if HAVE_MOD_DAV
-# include "mod_dav.h"
-#endif
#undef shutdown
}
-#if HAVE_MOD_DAV
-
-extern int phpdav_mkcol_test_handler(request_rec *r);
-extern int phpdav_mkcol_create_handler(request_rec *r);
-
-/* conf is being read twice (both here and in send_php()) */
-int send_parsed_php_dav_script(request_rec *r)
-{
- php_apache_info_struct *conf;
-
- conf = (php_apache_info_struct *) get_module_config(r->per_dir_config,
- &php4_module);
- return send_php(r, 0, 0, conf->dav_script);
-}
-
-static int php_type_checker(request_rec *r)
-{
- php_apache_info_struct *conf;
-
- conf = (php_apache_info_struct *)get_module_config(r->per_dir_config,
- &php4_module);
-
- /* If DAV support is enabled, use mod_dav's type checker. */
- if (conf->dav_script) {
- dav_api_set_request_handler(r, send_parsed_php_dav_script);
- dav_api_set_mkcol_handlers(r, phpdav_mkcol_test_handler,
- phpdav_mkcol_create_handler);
- /* leave the rest of the request to mod_dav */
- return dav_api_type_checker(r);
- }
-
- return DECLINED;
-}
-
-#else /* HAVE_MOD_DAV */
-
-# define php_type_checker NULL
-
-#endif /* HAVE_MOD_DAV */
-
handler_rec php_handlers[] =
{
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
- php_type_checker, /* type_checker */
+ NULL, /* type_checker */
NULL, /* fixups */
NULL /* logger */
#if MODULE_MAGIC_NUMBER >= 19970103
};
-static PHP_INI_MH(OnChangeApacheInt)
-{
- long *p;
- char *base = (char *) &php_apache_info;
-
- p = (long *) (base+(size_t) mh_arg1);
-
- if (new_value) {
- *p = atoi(new_value);
- return SUCCESS;
- } else {
- return FAILURE;
- }
-}
-
-
-static PHP_INI_MH(OnChangeApacheString)
-{
- char **p;
- char *base = (char *) &php_apache_info;
-
- p = (char **) (base+(size_t) mh_arg1);
-
- if (new_value) {
- *p = new_value;
- return SUCCESS;
- } else {
- return FAILURE;
- }
-}
-
PHP_INI_BEGIN()
- PHP_INI_ENTRY1("xbithack", "0", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, xbithack))
- PHP_INI_ENTRY1("engine", "1", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, engine))
- PHP_INI_ENTRY1("last_modified", "0", PHP_INI_ALL, OnChangeApacheInt, (void *) XtOffsetOf(php_apache_info_struct, last_modified))
- PHP_INI_ENTRY1("dav_script", NULL, PHP_INI_ALL, OnChangeApacheString, (void *) XtOffsetOf(php_apache_info_struct, dav_script))
+ STD_PHP_INI_ENTRY("xbithack", "0", PHP_INI_ALL, OnUpdateInt, xbithack, php_apache_info_struct, php_apache_info)
+ STD_PHP_INI_ENTRY("engine", "1", PHP_INI_ALL, OnUpdateInt, engine, php_apache_info_struct, php_apache_info)
+ STD_PHP_INI_ENTRY("last_modified", "0", PHP_INI_ALL, OnUpdateInt, last_modified, php_apache_info_struct, php_apache_info)
PHP_INI_END()