Skip to content

Commit 7f71683

Browse files
committed
Merge pull request #638
2 parents 3c6c181 + a5fe81b commit 7f71683

23 files changed

+5
-1925
lines changed

config.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ if test "$MONGODB" != "no"; then
173173
src/BSON/Timestamp.c \
174174
src/BSON/TimestampInterface.c \
175175
src/BSON/Type.c \
176-
src/BSON/TypeWrapper.c \
177176
src/BSON/Unserializable.c \
178177
src/BSON/UTCDateTime.c \
179178
src/BSON/UTCDateTimeInterface.c \

config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if (PHP_MONGODB != "no") {
8484

8585
EXTENSION("mongodb", "php_phongo.c phongo_compat.c", null, PHP_MONGODB_CFLAGS);
8686
ADD_SOURCES(configure_module_dirname + "/src", "bson.c bson-encode.c", "mongodb");
87-
ADD_SOURCES(configure_module_dirname + "/src/BSON", "Binary.c BinaryInterface.c Decimal128.c Decimal128Interface.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectID.c ObjectIDInterface.c Persistable.c Regex.c RegexInterface.c Serializable.c Timestamp.c TimestampInterface.c Type.c TypeWrapper.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c functions.c", "mongodb");
87+
ADD_SOURCES(configure_module_dirname + "/src/BSON", "Binary.c BinaryInterface.c Decimal128.c Decimal128Interface.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectID.c ObjectIDInterface.c Persistable.c Regex.c RegexInterface.c Serializable.c Timestamp.c TimestampInterface.c Type.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c functions.c", "mongodb");
8888
ADD_SOURCES(configure_module_dirname + "/src/MongoDB", "BulkWrite.c Command.c Cursor.c CursorId.c Manager.c Query.c ReadConcern.c ReadPreference.c Server.c WriteConcern.c WriteConcernError.c WriteError.c WriteResult.c", "mongodb");
8989
ADD_SOURCES(configure_module_dirname + "/src/MongoDB/Exception", "AuthenticationException.c BulkWriteException.c ConnectionException.c ConnectionTimeoutException.c Exception.c ExecutionTimeoutException.c InvalidArgumentException.c LogicException.c RuntimeException.c SSLConnectionException.c UnexpectedValueException.c WriteException.c", "mongodb");
9090
ADD_SOURCES(configure_module_dirname + "/src/MongoDB/Monitoring", "CommandFailedEvent.c CommandStartedEvent.c CommandSubscriber.c CommandSucceededEvent.c Subscriber.c functions.c", "mongodb");

php_bson.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ typedef struct {
4747
zend_class_entry *array;
4848
php_phongo_bson_typemap_types root_type;
4949
zend_class_entry *root;
50-
zend_class_entry *binary;
51-
zend_class_entry *decimal128;
52-
zend_class_entry *javascript;
53-
zend_class_entry *maxkey;
54-
zend_class_entry *minkey;
55-
zend_class_entry *objectid;
56-
zend_class_entry *regex;
57-
zend_class_entry *timestamp;
58-
zend_class_entry *utcdatetime;
5950
} php_phongo_bson_typemap;
6051

6152
typedef struct {
@@ -70,9 +61,9 @@ typedef struct {
7061
} php_phongo_bson_state;
7162

7263
#if PHP_VERSION_ID >= 70000
73-
#define PHONGO_BSON_STATE_INITIALIZER { {{ 0 }}, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, NULL, 0 }
64+
#define PHONGO_BSON_STATE_INITIALIZER { {{ 0 }}, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL }, NULL, 0 }
7465
#else
75-
#define PHONGO_BSON_STATE_INITIALIZER { NULL, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }, NULL, 0 }
66+
#define PHONGO_BSON_STATE_INITIALIZER { NULL, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL }, NULL, 0 }
7667
#endif
7768

7869
void php_phongo_zval_to_bson(zval *data, php_phongo_bson_flags_t flags, bson_t *bson, bson_t **bson_out TSRMLS_DC);

php_phongo.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,6 @@ PHP_MINIT_FUNCTION(mongodb)
23542354
php_phongo_persistable_init_ce(INIT_FUNC_ARGS_PASSTHRU);
23552355
php_phongo_regex_init_ce(INIT_FUNC_ARGS_PASSTHRU);
23562356
php_phongo_timestamp_init_ce(INIT_FUNC_ARGS_PASSTHRU);
2357-
php_phongo_typewrapper_init_ce(INIT_FUNC_ARGS_PASSTHRU);
23582357
php_phongo_utcdatetime_init_ce(INIT_FUNC_ARGS_PASSTHRU);
23592358

23602359
php_phongo_bulkwrite_init_ce(INIT_FUNC_ARGS_PASSTHRU);

php_phongo_classes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ extern zend_class_entry *php_phongo_writeexception_ce;
243243
extern zend_class_entry *php_phongo_bulkwriteexception_ce;
244244

245245
extern zend_class_entry *php_phongo_type_ce;
246-
extern zend_class_entry *php_phongo_typewrapper_ce;
247246
extern zend_class_entry *php_phongo_persistable_ce;
248247
extern zend_class_entry *php_phongo_unserializable_ce;
249248
extern zend_class_entry *php_phongo_serializable_ce;
@@ -284,7 +283,6 @@ extern void php_phongo_regex_init_ce(INIT_FUNC_ARGS);
284283
extern void php_phongo_serializable_init_ce(INIT_FUNC_ARGS);
285284
extern void php_phongo_timestamp_init_ce(INIT_FUNC_ARGS);
286285
extern void php_phongo_type_init_ce(INIT_FUNC_ARGS);
287-
extern void php_phongo_typewrapper_init_ce(INIT_FUNC_ARGS);
288286
extern void php_phongo_utcdatetime_init_ce(INIT_FUNC_ARGS);
289287
extern void php_phongo_unserializable_init_ce(INIT_FUNC_ARGS);
290288

src/BSON/TypeWrapper.c

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

src/bson-encode.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
#undef MONGOC_LOG_DOMAIN
4646
#define MONGOC_LOG_DOMAIN "PHONGO-BSON"
4747

48-
/* Forward declarations */
49-
static void php_phongo_bson_append(bson_t *bson, php_phongo_bson_flags_t flags, const char *key, long key_len, zval *entry TSRMLS_DC);
50-
5148
/* Determines whether the argument should be serialized as a BSON array or
5249
* document. IS_ARRAY is returned if the argument's keys are a sequence of
5350
* integers starting at zero; otherwise, IS_OBJECT is returned. */
@@ -121,33 +118,6 @@ static void php_phongo_bson_append_object(bson_t *bson, php_phongo_bson_flags_t
121118
return;
122119
}
123120

124-
if (Z_TYPE_P(object) == IS_OBJECT && instanceof_function(Z_OBJCE_P(object), php_phongo_typewrapper_ce TSRMLS_CC)) {
125-
#if PHP_VERSION_ID >= 70000
126-
zval retval;
127-
128-
zend_call_method_with_0_params(object, NULL, NULL, "toBSONType", &retval);
129-
#else
130-
zval *retval;
131-
132-
zend_call_method_with_0_params(&object, NULL, NULL, "toBSONType", &retval);
133-
#endif
134-
135-
if (Z_ISUNDEF(retval)) {
136-
/* zend_call_method() failed */
137-
return;
138-
}
139-
140-
#if PHP_VERSION_ID >= 70000
141-
php_phongo_bson_append(bson, flags, key, key_len, &retval TSRMLS_CC);
142-
#else
143-
php_phongo_bson_append(bson, flags, key, key_len, retval TSRMLS_CC);
144-
#endif
145-
146-
zval_ptr_dtor(&retval);
147-
148-
return;
149-
}
150-
151121
if (Z_TYPE_P(object) == IS_OBJECT && instanceof_function(Z_OBJCE_P(object), php_phongo_type_ce TSRMLS_CC)) {
152122
if (instanceof_function(Z_OBJCE_P(object), php_phongo_serializable_ce TSRMLS_CC)) {
153123
#if PHP_VERSION_ID >= 70000

0 commit comments

Comments
 (0)