Lines Matching refs:ctx

72 	php_struct *ctx;  in ZEND_TSRMLS_CACHE_DEFINE()  local
74 ctx = SG(server_context); in ZEND_TSRMLS_CACHE_DEFINE()
75 r = ctx->r; in ZEND_TSRMLS_CACHE_DEFINE()
87 php_struct *ctx; in php_apache_sapi_header_handler() local
90 ctx = SG(server_context); in php_apache_sapi_header_handler()
94 apr_table_unset(ctx->r->headers_out, sapi_header->header); in php_apache_sapi_header_handler()
98 apr_table_clear(ctx->r->headers_out); in php_apache_sapi_header_handler()
117 if (ctx->content_type) { in php_apache_sapi_header_handler()
118 efree(ctx->content_type); in php_apache_sapi_header_handler()
120 ctx->content_type = estrdup(val); in php_apache_sapi_header_handler()
130 ap_set_content_length(ctx->r, clen); in php_apache_sapi_header_handler()
132 apr_table_set(ctx->r->headers_out, sapi_header->header, val); in php_apache_sapi_header_handler()
134 apr_table_add(ctx->r->headers_out, sapi_header->header, val); in php_apache_sapi_header_handler()
149 php_struct *ctx = SG(server_context); in php_apache_sapi_send_headers() local
152 ctx->r->status = SG(sapi_headers).http_response_code; in php_apache_sapi_send_headers()
157 ctx->r->status_line = apr_pstrdup(ctx->r->pool, sline + 9); in php_apache_sapi_send_headers()
158 ctx->r->proto_num = 1000 + (sline[7]-'0'); in php_apache_sapi_send_headers()
160 apr_table_set(ctx->r->subprocess_env, "force-response-1.0", "true"); in php_apache_sapi_send_headers()
166 if (!ctx->content_type) { in php_apache_sapi_send_headers()
167 ctx->content_type = sapi_get_default_content_type(); in php_apache_sapi_send_headers()
169 ap_set_content_type(ctx->r, apr_pstrdup(ctx->r->pool, ctx->content_type)); in php_apache_sapi_send_headers()
170 efree(ctx->content_type); in php_apache_sapi_send_headers()
171 ctx->content_type = NULL; in php_apache_sapi_send_headers()
180 php_struct *ctx = SG(server_context); in php_apache_sapi_read_post() local
184 r = ctx->r; in php_apache_sapi_read_post()
185 brigade = ctx->brigade; in php_apache_sapi_read_post()
211 php_struct *ctx = SG(server_context); in php_apache_sapi_get_stat() local
214 ctx->finfo.st_uid = 0; in php_apache_sapi_get_stat()
215 ctx->finfo.st_gid = 0; in php_apache_sapi_get_stat()
217 ctx->finfo.st_uid = ctx->r->finfo.user; in php_apache_sapi_get_stat()
218 ctx->finfo.st_gid = ctx->r->finfo.group; in php_apache_sapi_get_stat()
220 ctx->finfo.st_dev = ctx->r->finfo.device; in php_apache_sapi_get_stat()
221 ctx->finfo.st_ino = ctx->r->finfo.inode; in php_apache_sapi_get_stat()
222 ctx->finfo.st_atime = apr_time_sec(ctx->r->finfo.atime); in php_apache_sapi_get_stat()
223 ctx->finfo.st_mtime = apr_time_sec(ctx->r->finfo.mtime); in php_apache_sapi_get_stat()
224 ctx->finfo.st_ctime = apr_time_sec(ctx->r->finfo.ctime); in php_apache_sapi_get_stat()
225 ctx->finfo.st_size = ctx->r->finfo.size; in php_apache_sapi_get_stat()
226 ctx->finfo.st_nlink = ctx->r->finfo.nlink; in php_apache_sapi_get_stat()
228 return &ctx->finfo; in php_apache_sapi_get_stat()
234 php_struct *ctx = SG(server_context); in php_apache_sapi_read_cookies() local
237 http_cookie = apr_table_get(ctx->r->headers_in, "cookie"); in php_apache_sapi_read_cookies()
246 php_struct *ctx = SG(server_context); in php_apache_sapi_getenv() local
249 if (ctx == NULL) { in php_apache_sapi_getenv()
253 env_var = apr_table_get(ctx->r->subprocess_env, name); in php_apache_sapi_getenv()
261 php_struct *ctx = SG(server_context); in php_apache_sapi_register_variables() local
262 const apr_array_header_t *arr = apr_table_elts(ctx->r->subprocess_env); in php_apache_sapi_register_variables()
275 …if (sapi_module.input_filter(PARSE_SERVER, "PHP_SELF", &ctx->r->uri, strlen(ctx->r->uri), &new_val… in php_apache_sapi_register_variables()
276 php_register_variable_safe("PHP_SELF", ctx->r->uri, new_val_len, track_vars_array); in php_apache_sapi_register_variables()
283 php_struct *ctx; in php_apache_sapi_flush() local
286 ctx = server_context; in php_apache_sapi_flush()
294 r = ctx->r; in php_apache_sapi_flush()
308 php_struct *ctx; in php_apache_sapi_log_message() local
311 ctx = SG(server_context); in php_apache_sapi_log_message()
348 if (ctx == NULL) { /* we haven't initialized our ctx yet, oh well */ in php_apache_sapi_log_message()
351 ap_log_rerror(APLOG_MARK, aplog_type, 0, ctx->r, "%s", msg); in php_apache_sapi_log_message()
366 php_struct *ctx = SG(server_context); in php_apache_sapi_get_request_time() local
367 return ((double) apr_time_as_msec(ctx->r->request_time)) / 1000.0; in php_apache_sapi_get_request_time()
501 static int php_apache_request_ctor(request_rec *r, php_struct *ctx) in php_apache_request_ctor() argument
534 ctx->r->user = apr_pstrdup(ctx->r->pool, SG(request_info).auth_user); in php_apache_request_ctor()
568 php_struct * volatile ctx; in php_handler() local
585 ctx = SG(server_context); in php_handler()
586 if (ctx == NULL || (ctx && ctx->request_processed && !strcmp(r->protocol, "INCLUDED"))) { in php_handler()
588 ctx = SG(server_context) = apr_pcalloc(r->pool, sizeof(*ctx)); in php_handler()
594 ctx->r = r; in php_handler()
595ctx = NULL; /* May look weird to null it here, but it is to catch the right case in the first_try … in php_handler()
597 parent_req = ctx->r; in php_handler()
598 ctx->r = r; in php_handler()
647 if (ctx == NULL) { in php_handler()
649 ctx = SG(server_context); in php_handler()
650 ctx->brigade = brigade; in php_handler()
652 if (php_apache_request_ctor(r, ctx)!=SUCCESS) { in php_handler()
657 parent_req = ctx->r; in php_handler()
663 if (php_apache_request_ctor(r, ctx)!=SUCCESS) { in php_handler()
678 ctx->r = r; in php_handler()
679 brigade = ctx->brigade; in php_handler()
707 apr_psprintf(ctx->r->pool, "%" APR_SIZE_T_FMT, zend_memory_peak_usage(1))); in php_handler()
714 ctx->request_processed = 1; in php_handler()
728 ctx->r = parent_req; in php_handler()