void *ptr = (void *)((char *)t+sizeof(mem_header)+PLATFORM_PADDING);
#if WIN32||WINNT
- snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%0.8X (%d bytes), script=%s\n", t->filename, t->lineno, ptr, t->size, SG(request_info).path_translated);
+ snprintf(memory_leak_buf, 512, "%s(%d) : Freeing 0x%0.8X (%d bytes), script=%s\n", t->filename, t->lineno, (unsigned long)ptr, t->size, SG(request_info).path_translated);
#else
- snprintf(memory_leak_buf, 512, "%s: Freeing 0x%0.8X (%d bytes), allocated in %s on line %d<br>\n", SG(request_info).path_translated, ptr, t->size,t->filename,t->lineno);
+ snprintf(memory_leak_buf, 512, "%s: Freeing 0x%0.8lX (%d bytes), allocated in %s on line %d<br>\n", SG(request_info).path_translated, (unsigned long)ptr, t->size,t->filename,t->lineno);
#endif
} else {
uint leak_count = (uint) data;
-void php_module_shutdown_for_exec(void)
+void php_module_shutdown_for_exec()
{
/* used to close fd's in the range 3.255 here, but it's problematic */
}
/* some systems are missing these from their header files */
#if APACHE
-PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mode SLS_DC)
+PHPAPI int apache_php_module_main(request_rec *r, int fd, int display_source_mode SLS_DC)
{
zend_file_handle file_handle;
#ifdef ZTS
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
- | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+ | Authors: Rasmus Lerdorf <rasmus@php.net> |
| (with helpful hints from Dean Gaudet <dgaudet@arctic.org> |
| PHP 4.0 patches by Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
# include "mod_dav.h"
#endif
-PHPAPI int apache_php3_module_main(request_rec *r, int fd, int display_source_mode SLS_DC);
+PHPAPI int apache_php_module_main(request_rec *r, int fd, int display_source_mode SLS_DC);
/* ### these should be defined in mod_php4.h or somewhere else */
#define USE_PATH 1
-void php3_save_umask()
+void php_save_umask()
{
saved_umask = umask(077);
umask(saved_umask);
};
-void php3_restore_umask()
+void php_restore_umask()
{
umask(saved_umask);
}
SG(request_info).query_string = r->args;
SG(request_info).path_translated = r->filename;
SG(request_info).request_uri = r->uri;
- SG(request_info).request_method = r->method;
+ SG(request_info).request_method = (char *)r->method;
SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE");
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
}
-int send_php3(request_rec *r, int display_source_mode, char *filename)
+int send_php(request_rec *r, int display_source_mode, char *filename)
{
int fd, retval;
SLS_FETCH();
return NOT_FOUND;
}
- /* If PHP parser engine has been turned off with a "php3_engine off"
+ /* If PHP parser engine has been turned off with an "engine off"
* directive, then decline to handle this request
*/
if (!php_apache_info.engine) {
SG(server_context) = r;
init_request_info(SLS_C);
- php3_save_umask();
+ php_save_umask();
chdir_file(filename);
add_common_vars(r);
add_cgi_vars(r);
- apache_php3_module_main(r, fd, display_source_mode SLS_CC);
+ apache_php_module_main(r, fd, display_source_mode SLS_CC);
/* Done, restore umask, turn off timeout, close file and return */
- php3_restore_umask();
+ php_restore_umask();
kill_timeout(r);
pclosef(r->pool, fd);
return OK;
}
-int send_parsed_php3(request_rec * r)
+int send_parsed_php(request_rec * r)
{
- return send_php3(r, 0, NULL);
+ return send_php(r, 0, NULL);
}
-int send_parsed_php3_source(request_rec * r)
+int send_parsed_php_source(request_rec * r)
{
- return send_php3(r, 0, NULL);
+ return send_php(r, 0, NULL);
}
/*
* Create the per-directory config structure with defaults
*/
-static void *php3_create_dir(pool * p, char *dummy)
+static void *php_create_dir(pool * p, char *dummy)
{
php_apache_info_struct *new;
}
-int php3_xbithack_handler(request_rec * r)
+int php_xbithack_handler(request_rec * r)
{
php_apache_info_struct *conf;
r->allowed |= (1 << METHODS) - 1;
return DECLINED;
}
- return send_parsed_php3(r);
+ return send_parsed_php(r);
}
-void php3_init_handler(server_rec *s, pool *p)
+void php_init_handler(server_rec *s, pool *p)
{
register_cleanup(p, NULL, php_module_shutdown, php_module_shutdown_for_exec);
php_module_startup(&sapi_module);
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_php3()) */
-int send_parsed_php3_dav_script(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_php3(r, 0, 0, conf->dav_script);
+ return send_php(r, 0, 0, conf->dav_script);
}
-static int php3_type_checker(request_rec *r)
+static int php_type_checker(request_rec *r)
{
php_apache_info_struct *conf;
/* If DAV support is enabled, use mod_dav's type checker. */
if (conf->dav_script) {
- dav_api_set_request_handler(r, send_parsed_php3_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 */
#else /* HAVE_MOD_DAV */
-# define php3_type_checker NULL
+# define php_type_checker NULL
#endif /* HAVE_MOD_DAV */
-handler_rec php3_handlers[] =
+handler_rec php_handlers[] =
{
- {"application/x-httpd-php3", send_parsed_php3},
- {"application/x-httpd-php3-source", send_parsed_php3_source},
- {"text/html", php3_xbithack_handler},
+ {"application/x-httpd-php3", send_parsed_php},
+ {"application/x-httpd-php3-source", send_parsed_php_source},
+ {"text/html", php_xbithack_handler},
{NULL}
};
-command_rec php3_commands[] =
+command_rec php_commands[] =
{
{"php4_value", php_apache_value_handler, NULL, OR_OPTIONS, TAKE2, "PHP Value Modifier"},
{"php4_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"},
module MODULE_VAR_EXPORT php4_module =
{
STANDARD_MODULE_STUFF,
- php3_init_handler, /* initializer */
- php3_create_dir, /* per-directory config creator */
+ php_init_handler, /* initializer */
+ php_create_dir, /* per-directory config creator */
NULL, /* dir merger */
NULL, /* per-server config creator */
NULL, /* merge server config */
- php3_commands, /* command table */
- php3_handlers, /* handlers */
+ php_commands, /* command table */
+ php_handlers, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
NULL, /* check auth */
NULL, /* check access */
- php3_type_checker, /* type_checker */
+ php_type_checker, /* type_checker */
NULL, /* fixups */
NULL /* logger */
#if MODULE_MAGIC_NUMBER >= 19970103