diff options
author | Stanislav Malyshev <stas@php.net> | 2007-08-08 21:06:28 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2007-08-08 21:06:28 +0000 |
commit | 6c8312fa03a2022bea896a6ee6316e4e4c398d53 (patch) | |
tree | 23a071e8f4031cb90eee78a40e8fbb39cbbba23c /sapi/embed/php_embed.c | |
parent | ef7166481700b670156f9ea80b84a53200ebc698 (diff) | |
download | php-git-6c8312fa03a2022bea896a6ee6316e4e4c398d53.tar.gz |
fix TSRM embed startup
Diffstat (limited to 'sapi/embed/php_embed.c')
-rw-r--r-- | sapi/embed/php_embed.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index 48644efadc..e1b08099df 100644 --- a/sapi/embed/php_embed.c +++ b/sapi/embed/php_embed.c @@ -143,9 +143,6 @@ int php_embed_init(int argc, char **argv PTSRMLS_DC) { zend_llist global_vars; #ifdef ZTS - zend_compiler_globals *compiler_globals; - zend_executor_globals *executor_globals; - php_core_globals *core_globals; sapi_globals_struct *sapi_globals; void ***tsrm_ls; #endif @@ -173,15 +170,6 @@ int php_embed_init(int argc, char **argv PTSRMLS_DC) tsrm_startup(1, 1, 0, NULL); #endif -#ifdef ZTS - compiler_globals = ts_resource(compiler_globals_id); - executor_globals = ts_resource(executor_globals_id); - core_globals = ts_resource(core_globals_id); - sapi_globals = ts_resource(sapi_globals_id); - tsrm_ls = ts_resource(0); - *ptsrm_ls = tsrm_ls; -#endif - ini_entries_len = strlen(HARDCODED_INI); php_embed_module.ini_entries = malloc(ini_entries_len+2); memcpy(php_embed_module.ini_entries, HARDCODED_INI, ini_entries_len+1); @@ -189,24 +177,24 @@ int php_embed_init(int argc, char **argv PTSRMLS_DC) sapi_startup(&php_embed_module); + if (argv) { + php_embed_module.executable_location = argv[0]; + } + if (php_embed_module.startup(&php_embed_module)==FAILURE) { return FAILURE; } - if (argv) { - php_embed_module.executable_location = argv[0]; - } +#ifdef ZTS + sapi_globals = ts_resource(sapi_globals_id); + tsrm_ls = ts_resource(0); + *ptsrm_ls = tsrm_ls; +#endif zend_llist_init(&global_vars, sizeof(char *), NULL, 0); /* Set some Embedded PHP defaults */ SG(options) |= SAPI_OPTION_NO_CHDIR; -#if 0 -// zend_alter_ini_entry("register_argc_argv", 19, "1", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); -// zend_alter_ini_entry("html_errors", 12, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); -// zend_alter_ini_entry("implicit_flush", 15, "1", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); -// zend_alter_ini_entry("max_execution_time", 19, "0", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); -#endif SG(request_info).argc=argc; SG(request_info).argv=argv; |