summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/basic_functions.h3
-rw-r--r--ext/standard/file.c4
-rw-r--r--ext/standard/file.h3
-rw-r--r--ext/standard/http_fopen_wrapper.c4
4 files changed, 8 insertions, 6 deletions
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 3135cf0e7a..07bd240fdc 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -141,9 +141,6 @@ typedef struct {
HashTable sm_protected_env_vars;
char *sm_allowed_env_vars;
-
- /* file.c */
- char *user_agent;
/* pageinfo.c */
long page_uid;
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 544cea3b4f..12d15a3b45 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -157,7 +157,9 @@ static void file_globals_dtor(php_file_globals *file_globals_p TSRMLS_DC)
PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("user_agent", NULL, PHP_INI_ALL, OnUpdateString, user_agent, php_basic_globals, basic_globals)
+ STD_PHP_INI_ENTRY("user_agent", NULL, PHP_INI_ALL, OnUpdateString, user_agent, php_file_globals, file_globals)
+ STD_PHP_INI_ENTRY("default_socket_timeout", "60", PHP_INI_ALL, OnUpdateInt, default_socket_timeout, php_file_globals, file_globals)
+ STD_PHP_INI_ENTRY("auto_detect_line_endings", "0", PHP_INI_ALL, OnUpdateInt, auto_detect_line_endings, php_file_globals, file_globals)
PHP_INI_END()
PHP_MINIT_FUNCTION(file)
diff --git a/ext/standard/file.h b/ext/standard/file.h
index c2af165679..bb561da663 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -115,6 +115,9 @@ typedef struct {
int pclose_ret;
HashTable ht_persistent_socks;
size_t def_chunk_size;
+ int auto_detect_line_endings;
+ int default_socket_timeout;
+ char *user_agent;
} php_file_globals;
#ifdef ZTS
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 5841cff75c..dc32f63774 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -203,8 +203,8 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, char *path, ch
if (context &&
php_stream_context_get_option(context, "http", "user_agent", &ua_zval) == SUCCESS) {
ua_str = Z_STRVAL_PP(ua_zval);
- } else if (BG(user_agent)) {
- ua_str = BG(user_agent);
+ } else if (FG(user_agent)) {
+ ua_str = FG(user_agent);
}
if (ua_str) {