Skip to content

Commit 7ccd38c

Browse files
committed
Fix zts
1 parent 7783427 commit 7ccd38c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

php_phongo.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ PHONGO_API zval* phongo_throw_exception_from_bson_error_t(bson_error_t *error TS
178178
}
179179
static void php_phongo_log(mongoc_log_level_t log_level, const char *log_domain, const char *message, void *user_data)
180180
{
181-
(void)user_data;TSRMLS_FETCH_FROM_CTX(user_data);
181+
TSRMLS_FETCH_FROM_CTX(user_data);
182+
(void)user_data;
182183

183184
switch(log_level) {
184185
case MONGOC_LOG_LEVEL_ERROR:
@@ -772,6 +773,7 @@ ssize_t phongo_stream_poll (mongoc_stream_poll_t *streams, size_t nstreams, int3
772773
php_pollfd *fds = NULL;
773774
size_t i;
774775
ssize_t rval = -1;
776+
TSRMLS_FETCH();
775777

776778
fds = emalloc(sizeof(*fds) * nstreams);
777779
for (i = 0; i < nstreams; i++) {
@@ -1198,7 +1200,7 @@ void php_phongo_result_to_zval(zval *retval, php_phongo_result_t *result) /* {{{
11981200
} /* }}} */
11991201

12001202

1201-
mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptions) /* {{{ */
1203+
mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptions TSRMLS_DC) /* {{{ */
12021204
{
12031205
php_stream_context *ctx = NULL;
12041206
mongoc_client_t *client = mongoc_client_new(uri);

php_phongo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void php_phongo_read_preference_to_zval(zval *retval, const mongoc_read_prefs_t
123123
void php_phongo_write_concern_to_zval(zval *retval, const mongoc_write_concern_t *write_concern);
124124
void php_phongo_result_to_zval(zval *retval, php_phongo_result_t *result);
125125

126-
mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptions);
126+
mongoc_client_t *php_phongo_make_mongo_client(const char *uri, zval *driverOptions TSRMLS_DC);
127127
void php_phongo_objectid_new_from_oid(zval *object, const bson_oid_t *oid TSRMLS_DC);
128128
void php_phongo_cursor_new_from_result(zval *object, php_phongo_result_t *result TSRMLS_DC);
129129
void php_phongo_cursor_id_new_from_id(zval *object, int64_t cursorid TSRMLS_DC);

src/MongoDB/Manager.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ PHP_METHOD(Manager, __construct)
7676
zend_restore_error_handling(&error_handling TSRMLS_CC);
7777

7878

79-
intern->client = php_phongo_make_mongo_client(uri, driverOptions);
79+
intern->client = php_phongo_make_mongo_client(uri, driverOptions TSRMLS_CC);
8080
if (!intern->client) {
8181
phongo_throw_exception(PHONGO_ERROR_RUNTIME TSRMLS_CC, "%s", "Failed to parse MongoDB URI");
8282
return;
@@ -274,7 +274,7 @@ PHP_METHOD(Manager, getServers)
274274

275275
MAKE_STD_ZVAL(obj);
276276

277-
phongo_server_init(obj, intern->client, ((mongoc_server_description_t *)set->items[i].item)->id);
277+
phongo_server_init(obj, intern->client, ((mongoc_server_description_t *)set->items[i].item)->id TSRMLS_CC);
278278
add_next_index_zval(return_value, obj);
279279
}
280280
}

0 commit comments

Comments
 (0)