8000 Remove zend_finish_startup() · php/php-src@f74d0a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit f74d0a2

Browse files
committed
Remove zend_finish_startup()
1 parent 50bacdc commit f74d0a2

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

Zend/zend.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ void (*zend_printf_to_smart_str)(smart_str *buf, const char *format, va_list ap)
7676
ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
7777
ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t filename_len);
7878
ZEND_API int (*zend_post_startup_cb)(void) = NULL;
79-
ZEND_API int (*zend_finish_startup)(void) = NULL;
8079

8180
void (*zend_on_timeout)(int seconds);
8281

Zend/zend.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ extern void (*zend_printf_to_smart_str)(smart_str *buf, const char *format, va_l
292292
extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
293293
extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t filename_len);
294294
extern ZEND_API int (*zend_post_startup_cb)(void);
295-
extern ZEND_API int (*zend_finish_startup)(void);
296295

297296
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
298297
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);

ext/opcache/ZendAccelerator.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ static zend_string *(*accelerator_orig_zend_resolve_path)(const char *filename,
128128
static zif_handler orig_chdir = NULL;
129129
static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
130130
static int (*orig_post_startup_cb)(void);
131-
static int (*orig_finish_startup)(void);
132131

133132
static void accel_gen_system_id(void);
134133
static int accel_post_startup(void);
@@ -2938,9 +2937,6 @@ static int accel_startup(zend_extension *extension)
29382937
orig_post_startup_cb = zend_post_startup_cb;
29392938
zend_post_startup_cb = accel_post_startup;
29402939

2941-
orig_finish_startup = zend_finish_startup;
2942-
zend_finish_startup = accel_finish_startup;
2943-
29442940
return SUCCESS;
29452941
}
29462942

@@ -3079,7 +3075,7 @@ static int accel_post_startup(void)
30793075

30803076
zend_optimizer_startup();
30813077

3082-
return SUCCESS;
3078+
return accel_finish_startup();
30833079
}
30843080

30853081
void accel_shutdown(void)
@@ -3655,15 +3651,6 @@ static int accel_preload(const char *config)
36553651

36563652
static int accel_finish_startup(void)
36573653
{
3658-
if (orig_finish_startup) {
3659-
int (*cb)(void) = orig_finish_startup;
3660-
3661-
orig_finish_startup = NULL;
3662-
if (cb() != SUCCESS) {
3663-
return FAILURE;
3664-
}
3665-
}
3666-
36673654
if (!ZCG(enabled) || !accel_startup_ok) {
36683655
return SUCCESS;
36693656
}
@@ -3687,6 +3674,11 @@ static int accel_finish_startup(void)
36873674
sapi_module.send_header = NULL;
36883675
sapi_module.getenv = NULL;
36893676

3677+
zend_interned_strings_switch_storage(1);
3678+
if (ZCG(accel_directives).interned_strings_buffer) {
3679+
zend_interned_strings_set_permanent_storage_copy_handlers(NULL, accel_use_permanent_interned_strings);
3680+
}
3681+
36903682
if (php_request_startup() == SUCCESS) {
36913683

36923684
/* don't send headers */
@@ -3722,6 +3714,8 @@ static int accel_finish_startup(void)
37223714
sapi_module.send_header = orig_send_header;
37233715
sapi_module.getenv = orig_getenv;
37243716

3717+
sapi_activate();
3718+
37253719
return ret;
37263720
}
37273721

main/main.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,10 +2445,6 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
24452445
zend_rc_debug = 1;
24462446
#endif
24472447

2448-
if (zend_finish_startup && zend_finish_startup() != SUCCESS) {
2449-
return FAILURE;
2450-
}
2451-
24522448
/* we're done */
24532449
return retval;
24542450
}

0 commit comments

Comments
 (0)
0