nxt_php_sapi.c (1980:43553aa72111) nxt_php_sapi.c (2019:8fcb7e44c663)
1/*
2 * Copyright (C) Max Romanov
3 * Copyright (C) Valentin V. Bartenev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include "php.h"
8#include "SAPI.h"

--- 190 unchanged lines hidden (view full) ---

199}
200
201
202ZEND_NAMED_FUNCTION(nxt_php_chdir)
203{
204 nxt_php_run_ctx_t *ctx;
205
206 ctx = SG(server_context);
1/*
2 * Copyright (C) Max Romanov
3 * Copyright (C) Valentin V. Bartenev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include "php.h"
8#include "SAPI.h"

--- 190 unchanged lines hidden (view full) ---

199}
200
201
202ZEND_NAMED_FUNCTION(nxt_php_chdir)
203{
204 nxt_php_run_ctx_t *ctx;
205
206 ctx = SG(server_context);
207 ctx->chdir = 1;
208
207
208 if (nxt_fast_path(ctx != NULL)) {
209 ctx->chdir = 1;
210 }
211
209 nxt_php_chdir_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
210}
211
212
213PHP_FUNCTION(fastcgi_finish_request)
214{
215 zend_auto_global *ag;
216 nxt_php_run_ctx_t *ctx;
217
218 if (nxt_slow_path(zend_parse_parameters_none() == FAILURE)) {
219#ifdef NXT_PHP8
220 RETURN_THROWS();
221#else
222 return;
223#endif
224 }
225
226 ctx = SG(server_context);
227
212 nxt_php_chdir_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
213}
214
215
216PHP_FUNCTION(fastcgi_finish_request)
217{
218 zend_auto_global *ag;
219 nxt_php_run_ctx_t *ctx;
220
221 if (nxt_slow_path(zend_parse_parameters_none() == FAILURE)) {
222#ifdef NXT_PHP8
223 RETURN_THROWS();
224#else
225 return;
226#endif
227 }
228
229 ctx = SG(server_context);
230
228 if (nxt_slow_path(ctx->req == NULL)) {
231 if (nxt_slow_path(ctx == NULL || ctx->req == NULL)) {
229 RETURN_FALSE;
230 }
231
232#ifdef NXT_PHP7
233 php_output_end_all();
234 php_header();
235#else
236#ifdef PHP_OUTPUT_NEWAPI

--- 1263 unchanged lines hidden ---
232 RETURN_FALSE;
233 }
234
235#ifdef NXT_PHP7
236 php_output_end_all();
237 php_header();
238#else
239#ifdef PHP_OUTPUT_NEWAPI

--- 1263 unchanged lines hidden ---