Skip to content

Commit 930ff02

Browse files
committed
PHPC-236: 5.3-zts build broken
1 parent f8be3a7 commit 930ff02

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

phongo_compat.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,11 @@
8989
# endif
9090
#endif
9191

92+
#if PHP_VERSION_ID < 50400
93+
# define GET_DEFAULT_CONTEXT() \
94+
ctx = FG(default_context) ? FG(default_context) : php_stream_context_alloc()
95+
#else
96+
# define GET_DEFAULT_CONTEXT() \
97+
ctx = FG(default_context) ? FG(default_context) : php_stream_context_alloc(TSRMLS_C)
98+
#endif
99+

php_phongo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptio
13071307
if (driverOptions && zend_hash_find(Z_ARRVAL_P(driverOptions), "context", strlen("context") + 1, (void**)&tmp) == SUCCESS) {
13081308
ctx = php_stream_context_from_zval(*tmp, 0);
13091309
} else {
1310-
ctx = FG(default_context) ? FG(default_context) : php_stream_context_alloc(TSRMLS_C);
1310+
GET_DEFAULT_CONTEXT();
13111311
}
13121312
muri = mongoc_client_get_uri(client);
13131313

0 commit comments

Comments
 (0)