summaryrefslogtreecommitdiff
path: root/sapi/apache_hooks
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-12-18 10:09:02 +0100
committerAnatol Belski <ab@php.net>2014-12-18 10:09:02 +0100
commit4b943c9c0dd4114adc78416c5241f11ad5c98a80 (patch)
treec9628d91eae3f580f9ebd73d2372e4c9089b2e00 /sapi/apache_hooks
parent79354ba6d0d6a1a4596f9ac66ee9bc3a34ed972b (diff)
parentdec8eb431adee340fb8dfb9ff33ed29d3279c35f (diff)
downloadphp-git-POST_NATIVE_TLS_MERGE.tar.gz
Merge remote-tracking branch 'origin/native-tls'POST_NATIVE_TLS_MERGE
Diffstat (limited to 'sapi/apache_hooks')
-rw-r--r--sapi/apache_hooks/mod_php7.c95
-rw-r--r--sapi/apache_hooks/php_apache.c78
-rw-r--r--sapi/apache_hooks/php_apache_http.h2
-rw-r--r--sapi/apache_hooks/sapi_apache.c22
4 files changed, 91 insertions, 106 deletions
diff --git a/sapi/apache_hooks/mod_php7.c b/sapi/apache_hooks/mod_php7.c
index 33e0931fb6..cd1e733f32 100644
--- a/sapi/apache_hooks/mod_php7.c
+++ b/sapi/apache_hooks/mod_php7.c
@@ -29,13 +29,13 @@
/* {{{ Prototypes
*/
-int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC);
+int apache_php_module_main(request_rec *r, int display_source_mode);
static void php_save_umask(void);
static void php_restore_umask(void);
-static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC);
-static char *sapi_apache_read_cookies(TSRMLS_D);
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC);
-static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC);
+static int sapi_apache_read_post(char *buffer, uint count_bytes);
+static char *sapi_apache_read_cookies(void);
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers);
+static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers);
static int send_php(request_rec *r, int display_source_mode, char *filename);
static int send_parsed_php(request_rec * r);
static int send_parsed_php_source(request_rec * r);
@@ -237,7 +237,7 @@ static void php_save_umask(void)
/* {{{ sapi_apache_ub_write
*/
-static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
+static int sapi_apache_ub_write(const char *str, uint str_length)
{
int ret=0;
@@ -253,7 +253,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_apache_flush
*/
-static void sapi_apache_flush(void *server_context TSRMLS_DC)
+static void sapi_apache_flush(void *server_context)
{
if (server_context) {
#if MODULE_MAGIC_NUMBER > 19970110
@@ -267,7 +267,7 @@ static void sapi_apache_flush(void *server_context TSRMLS_DC)
/* {{{ sapi_apache_read_post
*/
-static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
+static int sapi_apache_read_post(char *buffer, uint count_bytes)
{
uint total_read_bytes=0, read_bytes;
request_rec *r = (request_rec *) SG(server_context);
@@ -300,7 +300,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
/* {{{ sapi_apache_read_cookies
*/
-static char *sapi_apache_read_cookies(TSRMLS_D)
+static char *sapi_apache_read_cookies(void)
{
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, "HTTP_COOKIE");
}
@@ -308,7 +308,7 @@ static char *sapi_apache_read_cookies(TSRMLS_D)
/* {{{ sapi_apache_header_handler
*/
-static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_header_op_enum op, sapi_headers_struct *sapi_headers)
{
char *header_name, *header_content, *p;
request_rec *r = (request_rec *) SG(server_context);
@@ -361,7 +361,7 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
/* {{{ sapi_apache_send_headers
*/
-static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
+static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers)
{
if(SG(server_context) == NULL) { /* server_context is not here anymore */
return SAPI_HEADER_SEND_FAILED;
@@ -381,7 +381,7 @@ static int sapi_apache_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
/* {{{ sapi_apache_register_server_variables
*/
-static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_DC)
+static void sapi_apache_register_server_variables(zval *track_vars_array)
{
register int i;
array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env);
@@ -397,7 +397,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
} else {
val = "";
}
- php_register_variable(elts[i].key, val, track_vars_array TSRMLS_CC);
+ php_register_variable(elts[i].key, val, track_vars_array );
}
/* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
@@ -409,10 +409,10 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
if (symbol_table
&& !zend_hash_exists(symbol_table, "PATH_TRANSLATED", sizeof("PATH_TRANSLATED"))
&& zend_hash_find(symbol_table, "SCRIPT_FILENAME", sizeof("SCRIPT_FILENAME"), (void **) &path_translated)==SUCCESS) {
- php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array TSRMLS_CC);
+ php_register_variable("PATH_TRANSLATED", Z_STRVAL_PP(path_translated), track_vars_array);
}
- php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array TSRMLS_CC);
+ php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array);
}
/* }}} */
@@ -430,7 +430,7 @@ static int php_apache_startup(sapi_module_struct *sapi_module)
/* {{{ php_apache_log_message
*/
-static void php_apache_log_message(char *message TSRMLS_DC)
+static void php_apache_log_message(char *message)
{
if (SG(server_context)) {
#if MODULE_MAGIC_NUMBER >= 19970831
@@ -449,9 +449,8 @@ static void php_apache_log_message(char *message TSRMLS_DC)
*/
static void php_apache_request_shutdown(void *dummy)
{
- TSRMLS_FETCH();
AP(current_hook) = AP_CLEANUP;
- php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC);
+ php_output_set_status(PHP_OUTPUT_DISABLED);
SG(server_context) = NULL; /* The server context (request) is invalid by the time run_cleanups() is called */
if(SG(sapi_started)) {
php_request_shutdown(dummy);
@@ -468,7 +467,7 @@ static void php_apache_request_shutdown(void *dummy)
/* {{{ php_apache_sapi_activate
*/
-static int php_apache_sapi_activate(TSRMLS_D)
+static int php_apache_sapi_activate(void)
{
request_rec *r = (request_rec *) SG(server_context);
@@ -495,7 +494,7 @@ static int php_apache_sapi_activate(TSRMLS_D)
/* {{{ php_apache_get_stat
*/
-static struct stat *php_apache_get_stat(TSRMLS_D)
+static struct stat *php_apache_get_stat(void)
{
return &((request_rec *) SG(server_context))->finfo;
}
@@ -503,7 +502,7 @@ static struct stat *php_apache_get_stat(TSRMLS_D)
/* {{{ php_apache_getenv
*/
-static char *php_apache_getenv(char *name, size_t name_len TSRMLS_DC)
+static char *php_apache_getenv(char *name, size_t name_len)
{
return (char *) table_get(((request_rec *) SG(server_context))->subprocess_env, name);
}
@@ -569,7 +568,7 @@ static void php_restore_umask(void)
/* {{{ init_request_info
*/
-static void init_request_info(TSRMLS_D)
+static void init_request_info(void)
{
request_rec *r = ((request_rec *) SG(server_context));
char *content_length = (char *) table_get(r->subprocess_env, "CONTENT_LENGTH");
@@ -614,7 +613,7 @@ static void init_request_info(TSRMLS_D)
/* {{{ php_apache_alter_ini_entries
*/
-static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_DC)
+static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry)
{
zend_alter_ini_entry(per_dir_entry->key, per_dir_entry->key_length+1, per_dir_entry->value, per_dir_entry->value_length, per_dir_entry->type, PHP_INI_STAGE_ACTIVATE);
return 0;
@@ -623,7 +622,7 @@ static int php_apache_alter_ini_entries(php_per_dir_entry *per_dir_entry TSRMLS_
/* {{{ php_apache_get_default_mimetype
*/
-static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
+static char *php_apache_get_default_mimetype(request_rec *r)
{
char *mimetype;
@@ -631,7 +630,7 @@ static char *php_apache_get_default_mimetype(request_rec *r TSRMLS_DC)
/* Assume output will be of the default MIME type. Individual
scripts may change this later. */
char *tmpmimetype;
- tmpmimetype = sapi_get_default_content_type(TSRMLS_C);
+ tmpmimetype = sapi_get_default_content_type();
mimetype = pstrdup(r->pool, tmpmimetype);
efree(tmpmimetype);
} else {
@@ -647,7 +646,6 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
{
int retval;
php_per_dir_config *per_dir_conf;
- TSRMLS_FETCH();
if (AP(in_request)) {
zend_file_handle fh;
@@ -656,7 +654,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
fh.free_filename = 0;
fh.type = ZEND_HANDLE_FILENAME;
- zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, &fh);
+ zend_execute_scripts(ZEND_INCLUDE, NULL, 1, &fh);
return OK;
}
@@ -669,17 +667,17 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
per_dir_conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
if (per_dir_conf) {
- zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *) per_dir_conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries);
}
/* If PHP parser engine has been turned off with an "engine off"
* directive, then decline to handle this request
*/
if (!AP(engine)) {
- r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r);
r->allowed |= (1 << METHODS) - 1;
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return DECLINED;
}
@@ -691,7 +689,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
#if MODULE_MAGIC_NUMBER > 19961007
if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return retval;
}
@@ -701,7 +699,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
#if MODULE_MAGIC_NUMBER < 19970912
if ((retval = set_last_modified(r, r->finfo.st_mtime))) {
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return retval;
}
@@ -713,7 +711,7 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
}
/* Assume output will be of the default MIME type. Individual
scripts may change this later in the request. */
- r->content_type = php_apache_get_default_mimetype(r TSRMLS_CC);
+ r->content_type = php_apache_get_default_mimetype(r);
/* Init timeout */
hard_timeout("send", r);
@@ -726,8 +724,8 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
add_common_vars(r);
add_cgi_vars(r);
}
- init_request_info(TSRMLS_C);
- apache_php_module_main(r, display_source_mode TSRMLS_CC);
+ init_request_info();
+ apache_php_module_main(r, display_source_mode);
/* Done, restore umask, turn off timeout, close file and return */
php_restore_umask();
@@ -743,10 +741,9 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
static int send_parsed_php(request_rec * r)
{
int result = send_php(r, 0, NULL);
- TSRMLS_FETCH();
ap_table_setn(r->notes, "mod_php_memory_usage",
- ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 TSRMLS_CC)));
+ ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1)));
return result;
}
@@ -1178,7 +1175,6 @@ static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf,
static int php_xbithack_handler(request_rec * r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
if (!(r->finfo.st_mode & S_IXUSR)) {
r->allowed |= (1 << METHODS) - 1;
@@ -1186,12 +1182,12 @@ static int php_xbithack_handler(request_rec * r)
}
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
if (conf) {
- zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *) conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries);
}
if(!AP(xbithack)) {
r->allowed |= (1 << METHODS) - 1;
zend_try {
- zend_ini_deactivate(TSRMLS_C);
+ zend_ini_deactivate();
} zend_end_try();
return DECLINED;
}
@@ -1249,8 +1245,7 @@ static void php_init_handler(server_rec *s, pool *p)
}
#if MODULE_MAGIC_NUMBER >= 19980527
{
- TSRMLS_FETCH();
- if (PG(expose_php)) {
+ if (PG(expose_php)) {
ap_add_version_component("PHP/" PHP_VERSION);
}
}
@@ -1263,12 +1258,11 @@ static int php_run_hook(php_handler *handler, request_rec *r)
zval *ret = NULL;
php_per_dir_config *conf;
- TSRMLS_FETCH();
if(!AP(apache_config_loaded)) {
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
if (conf)
- zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries TSRMLS_CC);
+ zend_hash_apply((HashTable *)conf->ini_settings, (apply_func_t) php_apache_alter_ini_entries);
AP(apache_config_loaded) = 1;
}
if (!handler->name) {
@@ -1281,8 +1275,8 @@ static int php_run_hook(php_handler *handler, request_rec *r)
add_cgi_vars(r);
}
SG(server_context) = r;
- init_request_info(TSRMLS_C);
- apache_php_module_hook(r, handler, &ret TSRMLS_CC);
+ init_request_info();
+ apache_php_module_hook(r, handler, &ret);
php_restore_umask();
kill_timeout(r);
if (ret) {
@@ -1296,7 +1290,6 @@ static int php_run_hook(php_handler *handler, request_rec *r)
static int php_uri_translation(request_rec *r)
{
php_per_server_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_URI_TRANS;
conf = (php_per_server_config *) get_module_config(r->server->module_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_equals(&conf->uri_handlers,
@@ -1307,7 +1300,6 @@ static int php_uri_translation(request_rec *r)
static int php_header_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_HEADER_PARSE;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_http_error(&conf->headers_handlers,
@@ -1318,7 +1310,6 @@ static int php_header_hook(request_rec *r)
static int php_auth_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_AUTHENTICATION;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_equals(&conf->auth_handlers,
@@ -1330,7 +1321,6 @@ static int php_access_hook(request_rec *r)
{
php_per_dir_config *conf;
int status = DECLINED;
- TSRMLS_FETCH();
AP(current_hook) = AP_ACCESS_CONTROL;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
status = sapi_stack_apply_with_argument_stop_if_http_error(&conf->access_handlers,
@@ -1343,7 +1333,6 @@ static int php_access_hook(request_rec *r)
static int php_type_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_TYPE_CHECKING;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_equals(&conf->type_handlers,
@@ -1355,7 +1344,6 @@ static int php_type_hook(request_rec *r)
static int php_fixup_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_FIXUP;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_http_error(&conf->fixup_handlers,
@@ -1367,7 +1355,6 @@ static int php_fixup_hook(request_rec *r)
static int php_logger_hook(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_LOGGING;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_stop_if_http_error(&conf->logger_handlers,
@@ -1380,7 +1367,6 @@ static int php_post_read_hook(request_rec *r)
{
php_per_dir_config *conf;
php_per_server_config *svr;
- TSRMLS_FETCH();
AP(current_hook) = AP_POST_READ;
svr = get_module_config(r->server->module_config, &php7_module);
if(ap_is_initial_req(r)) {
@@ -1395,7 +1381,6 @@ static int php_post_read_hook(request_rec *r)
static int php_response_handler(request_rec *r)
{
php_per_dir_config *conf;
- TSRMLS_FETCH();
AP(current_hook) = AP_RESPONSE;
conf = (php_per_dir_config *) get_module_config(r->per_dir_config, &php7_module);
return sapi_stack_apply_with_argument_all(&conf->response_handlers, ZEND_STACK_APPLY_BOTTOMUP, (int (*)(void *element, void *)) php_run_hook, r);
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c
index e5bd3f5d61..57b4505f10 100644
--- a/sapi/apache_hooks/php_apache.c
+++ b/sapi/apache_hooks/php_apache.c
@@ -105,7 +105,7 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
-static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRMLS_DC)
+static void php_apache_globals_ctor(php_apache_info_struct *apache_globals)
{
apache_globals->in_request = 0;
}
@@ -113,20 +113,20 @@ static void php_apache_globals_ctor(php_apache_info_struct *apache_globals TSRML
#define APREQ_GET_THIS(ZVAL) if (NULL == (ZVAL = getThis())) { \
php_error(E_WARNING, "%s(): underlying ApacheRequest object missing", \
- get_active_function_name(TSRMLS_C)); \
+ get_active_function_name()); \
RETURN_FALSE; \
}
#define APREQ_GET_REQUEST(ZVAL, R) APREQ_GET_THIS(ZVAL); \
- R = get_apache_request(ZVAL TSRMLS_CC)
+ R = get_apache_request(ZVAL)
-static void php_apache_request_free(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+static void php_apache_request_free(zend_rsrc_list_entry *rsrc)
{
zval *z = (zval *)rsrc->ptr;
/* fprintf(stderr, "%s() %p\n", __FUNCTION__, z); */
zval_ptr_dtor(&z);
}
-static request_rec *get_apache_request(zval *z TSRMLS_DC)
+static request_rec *get_apache_request(zval *z)
{
request_rec *r;
zval **addr;
@@ -137,28 +137,28 @@ static request_rec *get_apache_request(zval *z TSRMLS_DC)
}
if (Z_TYPE_P(z) != IS_OBJECT) {
- php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): wrapper is not an object", get_active_function_name());
return NULL;
}
if (zend_hash_index_find(Z_OBJPROP_P(z), 0, (void **)&addr) == FAILURE) {
- php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): underlying object missing", get_active_function_name());
return NULL;
}
r = (request_rec *)Z_LVAL_PP(addr);
if (!r) {
- php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): request_rec invalid", get_active_function_name());
return NULL;
}
return r;
}
-/* {{{ php_apache_request_new(request_rec *r TSRMLS_DC)
+/* {{{ php_apache_request_new(request_rec *r)
* create a new zval-instance for ApacheRequest that wraps request_rec
*/
-zval *php_apache_request_new(request_rec *r TSRMLS_DC)
+zval *php_apache_request_new(request_rec *r)
{
zval *req;
zval *addr;
@@ -210,7 +210,7 @@ static void apache_request_string_slot(int offset, INTERNAL_FUNCTION_PARAMETERS)
int new_value_len;
char **target;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &new_value, &new_value_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &new_value, &new_value_len) == FAILURE) {
return;
}
@@ -260,7 +260,7 @@ static void apache_request_int_slot(int offset, INTERNAL_FUNCTION_PARAMETERS)
long old_value, new_value;
long *target;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &new_value) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &new_value) == FAILURE) {
return;
}
@@ -504,7 +504,7 @@ PHP_FUNCTION(apache_request_content_length)
long zlen;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &zlen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &zlen) == FAILURE) {
return;
}
@@ -584,7 +584,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
zend_bool replace = 0;
HashPosition pos;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|zb", &first, &second, &replace) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|zb", &first, &second, &replace) == FAILURE) {
RETURN_FALSE;
}
@@ -614,7 +614,7 @@ static void add_header_to_table(table *t, INTERNAL_FUNCTION_PARAMETERS)
break;
case HASH_KEY_IS_LONG:
default:
- php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name(TSRMLS_C));
+ php_error(E_WARNING, "%s(): Can only add STRING keys to headers!", get_active_function_name());
break;
}
@@ -715,7 +715,7 @@ PHP_FUNCTION(apache_request_remote_host)
request_rec *r;
char *res;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &type) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &type) == FAILURE) {
return;
}
@@ -743,7 +743,7 @@ PHP_FUNCTION(apache_request_update_mtime)
request_rec *r;
long mtime = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mtime) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &mtime) == FAILURE) {
return;
}
@@ -931,7 +931,7 @@ PHP_FUNCTION(apache_request_basic_auth_pw)
const char *pw;
long status;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zpw) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &zpw) == FAILURE) {
return;
}
@@ -963,7 +963,7 @@ PHP_FUNCTION(apache_request_send_http_header)
char *type = NULL;
int typelen;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &typelen) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() , "|s", &type, &typelen) == FAILURE) {
return;
}
@@ -1034,7 +1034,7 @@ PHP_FUNCTION(apache_request_send_error_response)
request_rec *r;
long rec = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &rec) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &rec) == FAILURE) {
return;
}
@@ -1049,7 +1049,7 @@ PHP_FUNCTION(apache_request_set_content_length)
zval *id;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &length) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
return;
}
@@ -1092,7 +1092,7 @@ PHP_FUNCTION(apache_request_rputs)
zval *id;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &buffer, &buffer_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &buffer, &buffer_len) == FAILURE) {
return;
}
@@ -1136,7 +1136,7 @@ PHP_FUNCTION(apache_request_log_error)
long facility = APLOG_ERR;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &z_errstr, &z_errstr_len, &facility) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &z_errstr, &z_errstr_len, &facility) == FAILURE) {
return;
}
@@ -1158,7 +1158,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri)
int file_len;
request_rec *r, *sub_r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
@@ -1168,7 +1168,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r TSRMLS_CC);
+ return_value = php_apache_request_new(sub_r);
}
/* }}} */
@@ -1183,7 +1183,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file)
int file_len;
request_rec *r, *sub_r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &file, &file_len) == FAILURE) {
return;
}
@@ -1194,7 +1194,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r TSRMLS_CC);
+ return_value = php_apache_request_new(sub_r);
}
/* }}} */
@@ -1209,7 +1209,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri)
int file_len, method_len;
request_rec *r, *sub_r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &method, &method_len, &file, &file_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &method, &method_len, &file, &file_len) == FAILURE) {
return;
}
@@ -1220,7 +1220,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r TSRMLS_CC);
+ return_value = php_apache_request_new(sub_r);
}
/* }}} */
@@ -1255,7 +1255,7 @@ PHP_FUNCTION(apache_request_internal_redirect)
int new_uri_len;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &new_uri, &new_uri_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &new_uri, &new_uri_len) == FAILURE) {
return;
}
@@ -1271,7 +1271,7 @@ PHP_FUNCTION(apache_request_send_header_field)
zval *id;
request_rec *r;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &fieldname, &fieldname_len, &fieldval, &fieldval_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &fieldname, &fieldname_len, &fieldval, &fieldval_len) == FAILURE) {
return;
}
@@ -1394,14 +1394,14 @@ static PHP_MINIT_FUNCTION(apache)
#ifdef ZTS
ts_allocate_id(&php_apache_info_id, sizeof(php_apache_info_struct), (ts_allocate_ctor) php_apache_globals_ctor, NULL);
#else
- php_apache_globals_ctor(&php_apache_info TSRMLS_CC);
+ php_apache_globals_ctor(&php_apache_info);
#endif
REGISTER_INI_ENTRIES();
le_apachereq = zend_register_list_destructors_ex(php_apache_request_free, NULL, "ApacheRequest", module_number);
INIT_OVERLOADED_CLASS_ENTRY(ce, "ApacheRequest", php_apache_request_class_functions, NULL, NULL, NULL);
- apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL TSRMLS_CC);
+ apacherequest_class_entry = zend_register_internal_class_ex(&ce, NULL);
REGISTER_LONG_CONSTANT("OK", OK, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("DECLINED", DECLINED, CONST_CS | CONST_PERSISTENT);
@@ -1551,7 +1551,7 @@ PHP_FUNCTION(apache_note)
int arg_name_len, arg_val_len;
char *note_val;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &arg_name, &arg_name_len, &arg_val, &arg_val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &arg_name, &arg_name_len, &arg_val, &arg_val_len) == FAILURE) {
return;
}
@@ -1714,7 +1714,7 @@ PHP_FUNCTION(virtual)
int filename_len;
request_rec *rr = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
@@ -1732,8 +1732,8 @@ PHP_FUNCTION(virtual)
RETURN_FALSE;
}
- php_output_end_all(TSRMLS_C);
- php_header(TSRMLS_C);
+ php_output_end_all();
+ php_header();
if (run_sub_req(rr)) {
php_error(E_WARNING, "Unable to include '%s' - request execution failed", filename);
@@ -1811,7 +1811,7 @@ PHP_FUNCTION(apache_setenv)
char *var = NULL, *val = NULL;
request_rec *r = (request_rec *) SG(server_context);
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|b", &var, &var_len, &val, &val_len, &top) == FAILURE) {
RETURN_FALSE;
}
@@ -1835,7 +1835,7 @@ PHP_FUNCTION(apache_lookup_uri)
int filename_len;
request_rec *rr=NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
return;
}
diff --git a/sapi/apache_hooks/php_apache_http.h b/sapi/apache_hooks/php_apache_http.h
index e6610741c7..f79bd91c50 100644
--- a/sapi/apache_hooks/php_apache_http.h
+++ b/sapi/apache_hooks/php_apache_http.h
@@ -41,4 +41,4 @@
zval *php_apache_request_new(request_rec *r);
-int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC);
+int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret);
diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c
index daaad4e39d..78e7c8cbd3 100644
--- a/sapi/apache_hooks/sapi_apache.c
+++ b/sapi/apache_hooks/sapi_apache.c
@@ -25,11 +25,11 @@
/* {{{ apache_php_module_main
*/
-int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
+int apache_php_module_main(request_rec *r, int display_source_mode)
{
zend_file_handle file_handle;
- if (php_request_startup(TSRMLS_C) == FAILURE) {
+ if (php_request_startup() == FAILURE) {
return FAILURE;
}
/* sending a file handle to another dll is not working
@@ -39,7 +39,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
zend_syntax_highlighter_ini syntax_highlighter_ini;
php_get_highlight_struct(&syntax_highlighter_ini);
- if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini TSRMLS_CC)){
+ if (highlight_file(SG(request_info).path_translated, &syntax_highlighter_ini)){
return OK;
} else {
return NOT_FOUND;
@@ -50,7 +50,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
file_handle.filename = SG(request_info).path_translated;
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
- (void) php_execute_script(&file_handle TSRMLS_CC);
+ (void) php_execute_script(&file_handle);
}
AP(in_request) = 0;
@@ -60,7 +60,7 @@ int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
/* {{{ apache_php_module_hook
*/
-int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRMLS_DC)
+int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret)
{
zend_file_handle file_handle;
zval *req;
@@ -70,24 +70,24 @@ int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRM
signal(SIGCHLD, sigchld_handler);
#endif
if(AP(current_hook) == AP_RESPONSE) {
- if (php_request_startup_for_hook(TSRMLS_C) == FAILURE)
+ if (php_request_startup_for_hook() == FAILURE)
return FAILURE;
}
else {
- if (php_request_startup_for_hook(TSRMLS_C) == FAILURE)
+ if (php_request_startup_for_hook() == FAILURE)
return FAILURE;
}
req = php_apache_request_new(r);
- php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER]);
switch(handler->type) {
case AP_HANDLER_TYPE_FILE:
- php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+ php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER]);
memset(&file_handle, 0, sizeof(file_handle));
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = handler->name;
- (void) php_execute_simple_script(&file_handle, ret TSRMLS_CC);
+ (void) php_execute_simple_script(&file_handle, ret);
break;
case AP_HANDLER_TYPE_METHOD:
if( (tmp = strstr(handler->name, "::")) != NULL && *(tmp+2) != '\0' ) {
@@ -99,7 +99,7 @@ int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRM
ALLOC_ZVAL(method);
ZVAL_STRING(method, tmp +2, 1);
*tmp = ':';
- call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL TSRMLS_CC);
+ call_user_function_ex(EG(function_table), &class, method, ret, 0, NULL, 0, NULL);
zval_dtor(class);
zval_dtor(method);
}