Skip to content

Commit a2261a9

Browse files
committed
Merge pull request #361
2 parents 9ee0b75 + ae6016e commit a2261a9

29 files changed

+470
-1311
lines changed

php_phongo.c

Lines changed: 123 additions & 684 deletions
Large diffs are not rendered by default.

php_phongo.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ extern zend_module_entry mongodb_module_entry;
4040
# define PHONGO_API
4141
#endif
4242

43-
#ifdef ZTS
44-
# include "TSRM.h"
45-
# define PHONGO_STREAM_CTX(x) x
46-
#else
47-
# define PHONGO_STREAM_CTX(x) NULL
48-
#endif
49-
5043
ZEND_BEGIN_MODULE_GLOBALS(mongodb)
5144
char *debug;
5245
FILE *debug_fd;
@@ -102,23 +95,6 @@ typedef enum {
10295
PHONGO_ERROR_LOGIC = 9
10396
} php_phongo_error_domain_t;
10497

105-
typedef struct
106-
{
107-
void (*writer)(mongoc_stream_t *stream, int32_t timeout_msec, ssize_t sent, size_t iovcnt);
108-
} php_phongo_stream_logger;
109-
110-
typedef struct
111-
{
112-
mongoc_stream_t vtable;
113-
php_stream *stream;
114-
const mongoc_uri_t *uri;
115-
const mongoc_host_list_t *host;
116-
#if ZTS
117-
void ***tsrm_ls;
118-
#endif
119-
} php_phongo_stream_socket;
120-
121-
12298
PHONGO_API zend_class_entry* phongo_exception_from_mongoc_domain(uint32_t /* mongoc_error_domain_t */ domain, uint32_t /* mongoc_error_code_t */ code);
12399
PHONGO_API zend_class_entry* phongo_exception_from_phongo_domain(php_phongo_error_domain_t domain);
124100
void phongo_throw_exception(php_phongo_error_domain_t domain TSRMLS_DC, const char *format, ...)
@@ -146,7 +122,6 @@ bool phongo_execute_write (zval *manager, const char
146122
int phongo_execute_command (zval *manager, const char *db, zval *zcommand, zval *zreadPreference, int server_id, zval *return_value, int return_value_used TSRMLS_DC);
147123
int phongo_execute_query (zval *manager, const char *namespace, zval *zquery, zval *zreadPreference, int server_id, zval *return_value, int return_value_used TSRMLS_DC);
148124

149-
mongoc_stream_t* phongo_stream_initiator (const mongoc_uri_t *uri, const mongoc_host_list_t *host, void *user_data, bson_error_t *error);
150125
const mongoc_read_concern_t* phongo_read_concern_from_zval (zval *zread_concern TSRMLS_DC);
151126
const mongoc_read_prefs_t* phongo_read_preference_from_zval(zval *zread_preference TSRMLS_DC);
152127
const mongoc_write_concern_t* phongo_write_concern_from_zval (zval *zwrite_concern TSRMLS_DC);

php_phongo_structs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ typedef struct {
8282
PHONGO_ZEND_OBJECT_PRE
8383
mongoc_client_t *client;
8484
char *pem_file;
85-
PHONGO_STRUCT_ZVAL driverOptions;
8685
PHONGO_ZEND_OBJECT_POST
8786
} php_phongo_manager_t;
8887

src/MongoDB/Manager.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -362,18 +362,6 @@ static void php_phongo_manager_free_object(phongo_free_object_arg *object TSRMLS
362362
mongoc_client_destroy(intern->client);
363363
}
364364

365-
if (intern->pem_file) {
366-
efree(intern->pem_file);
367-
}
368-
369-
#if PHP_VERSION_ID >= 70000
370-
zval_ptr_dtor(&intern->driverOptions);
371-
#else
372-
if (intern->driverOptions) {
373-
zval_ptr_dtor(&intern->driverOptions);
374-
}
375-
#endif
376-
377365
#if PHP_VERSION_ID < 70000
378366
efree(intern);
379367
#endif

tests/connect/bug0720.phpt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ require_once __DIR__ . "/../utils/basic.inc";
99
$SSL_DIR = realpath(__DIR__ . '/../../scripts/ssl/');
1010

1111
$driverOptions = [
12-
'peer_name' => 'server',
13-
'verify_peer' => true,
14-
'verify_peer_name' => true,
15-
'allow_self_signed' => false,
16-
'cafile' => $SSL_DIR . '/ca.pem', /* Defaults to openssl.cafile */
12+
// libmongoc does not allow the hostname to be overridden as "server"
13+
'allow_invalid_hostname' => true,
14+
'ca_file' => $SSL_DIR . '/ca.pem',
1715
];
1816

1917
$manager = new MongoDB\Driver\Manager(STANDALONE_SSL, ['ssl' => true], $driverOptions);

tests/connect/standalone-ssl-0001.phpt

Lines changed: 0 additions & 50 deletions
This file was deleted.

tests/connect/standalone-ssl-0002.phpt

Lines changed: 0 additions & 63 deletions
This file was deleted.

tests/connect/standalone-ssl-0003.phpt

Lines changed: 0 additions & 47 deletions
This file was deleted.

tests/connect/standalone-ssl-0004.phpt

Lines changed: 0 additions & 50 deletions
This file was deleted.

tests/connect/standalone-ssl-0005.phpt

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)