Skip to content

Commit 857ab51

Browse files
committed
Use php_stream_context_from_zval() to get default stream context
This initializes the default context if it is not already set.
1 parent 3b06e81 commit 857ab51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

php_phongo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,8 @@ static mongoc_client_t *php_phongo_make_mongo_client(php_phongo_manager_t *manag
19421942
ctx = php_stream_context_from_zval(*zcontext, 0);
19431943
#endif
19441944
} else {
1945-
ctx = FG(default_context) ? FG(default_context) : php_stream_context_alloc(TSRMLS_C);
1945+
zval *tmp = NULL; /* PHP 5.x requires an lvalue */
1946+
ctx = php_stream_context_from_zval(tmp, 0);
19461947
}
19471948

19481949
if (mongoc_uri_get_ssl(uri)) {

0 commit comments

Comments
 (0)