Skip to content
Browse files

PHPEMBED: slight revert

Summary: need to set ini at multiple levels, it seems

Reviewed By: boz

Test Plan: revert

Revert Plan: revert




git-svn-id: svn+ssh://tubbs/svnroot/projects/phpembed/trunk@65910 2c7ba8d8-a2f7-0310-a573-de162e16dcc7
  • Loading branch information...
1 parent eb51c6c commit d19114b6dfb5dcca906f127ae991537d666ad7c6 boz committed Oct 27, 2007
Showing with 18 additions and 15 deletions.
  1. +18 −15 src/php_cxx.cpp
View
33 src/php_cxx.cpp
@@ -959,25 +959,28 @@ php::php(bool _type_warnings)
PUSH_CTX();
- // ADAPTED from php_embed_init
- php_set_ini_entry("register_argc_argv", "1", PHP_INI_STAGE_ACTIVATE);
- php_set_ini_entry("html_errors", "0", PHP_INI_STAGE_ACTIVATE);
- php_set_ini_entry("implicit_flush", "1", PHP_INI_STAGE_ACTIVATE);
- php_set_ini_entry("max_execution_time", "0", PHP_INI_STAGE_ACTIVATE);
-
- // we don't have get or post or cookie data in an embedded context
- php_set_ini_entry("variables_order", "S", PHP_INI_STAGE_ACTIVATE);
-
- // CLIENTS: you may want to add your own ini modifications here
+ /* Set some Embedded PHP defaults */
+ 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);
+ zend_alter_ini_entry("variables_order", 16, "S", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
+
+ if (php_request_startup(TSRMLS_C)==FAILURE) {
+ internal_error("PHP ERROR: failed initializing php_request\n");
+ status = FAIL;
+ }
- // ADAPTED from php_embed_init
SG(options) |= SAPI_OPTION_NO_CHDIR;
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
- php_request_startup( TSRMLS_C );
+ PG(during_request_startup) = 0;
- PG( during_request_startup) = 0;
+ // as an embedded module, we don't want any PHP timeout!
+ php_set_ini_entry("max_execution_time", "0", PHP_INI_STAGE_ACTIVATE);
+
+ // we don't have get or post or cookie data in an embedded context
+ php_set_ini_entry("variables_order", "S", PHP_INI_STAGE_ACTIVATE);
POP_CTX();
}
@@ -1022,7 +1025,7 @@ int php::init_global_php(){
setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */
setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
-#endif
+#endif
#ifdef ZTS
// PHPE: if they want threads, let's give them more than 1!
@@ -1039,7 +1042,7 @@ int php::init_global_php(){
if (php_embed_module.startup(&php_embed_module)==FAILURE) {
return FAILURE;
}
-
+
zend_llist_init(&global_vars, sizeof(char *), NULL, 0);
return SUCCESS;

0 comments on commit d19114b

Please sign in to comment.
Something went wrong with that request. Please try again.