Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions src/BSON/MaxKey.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,7 @@ static PHP_METHOD(MongoDB_BSON_MaxKey, __unserialize)
PHONGO_PARSE_PARAMETERS_END();
}

/* MongoDB\BSON\MaxKey object handlers */
static zend_object_handlers phongo_handler_maxkey;

static void phongo_maxkey_free_object(zend_object* object)
{
PHONGO_INTERN_FROM_Z_OBJ(maxkey, object);

zend_object_std_dtor(&intern->std);
}

static zend_object* phongo_maxkey_create_object(zend_class_entry* class_type)
{
PHONGO_INTERN_OBJECT_ALLOC(maxkey, class_type);

intern->std.handlers = &phongo_handler_maxkey;

return &intern->std;
}

void phongo_maxkey_init_ce(INIT_FUNC_ARGS)
{
phongo_maxkey_ce = register_class_MongoDB_BSON_MaxKey(phongo_maxkey_interface_ce, phongo_json_serializable_ce, phongo_type_ce);
phongo_maxkey_ce->create_object = phongo_maxkey_create_object;

memcpy(&phongo_handler_maxkey, phongo_get_std_object_handlers(), sizeof(zend_object_handlers));
/* Re-assign default handler previously removed in phongo.c */
phongo_handler_maxkey.clone_obj = zend_objects_clone_obj;
phongo_handler_maxkey.free_obj = phongo_maxkey_free_object;
phongo_handler_maxkey.offset = XtOffsetOf(phongo_maxkey_t, std);
phongo_maxkey_ce = register_class_MongoDB_BSON_MaxKey(phongo_maxkey_interface_ce, phongo_json_serializable_ce, phongo_type_ce);
}
28 changes: 1 addition & 27 deletions src/BSON/MinKey.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,7 @@ static PHP_METHOD(MongoDB_BSON_MinKey, __unserialize)
PHONGO_PARSE_PARAMETERS_END();
}

/* MongoDB\BSON\MinKey object handlers */
static zend_object_handlers phongo_handler_minkey;

static void phongo_minkey_free_object(zend_object* object)
{
PHONGO_INTERN_FROM_Z_OBJ(minkey, object);

zend_object_std_dtor(&intern->std);
}

static zend_object* phongo_minkey_create_object(zend_class_entry* class_type)
{
PHONGO_INTERN_OBJECT_ALLOC(minkey, class_type);

intern->std.handlers = &phongo_handler_minkey;

return &intern->std;
}

void phongo_minkey_init_ce(INIT_FUNC_ARGS)
{
phongo_minkey_ce = register_class_MongoDB_BSON_MinKey(phongo_minkey_interface_ce, phongo_json_serializable_ce, phongo_type_ce);
phongo_minkey_ce->create_object = phongo_minkey_create_object;

memcpy(&phongo_handler_minkey, phongo_get_std_object_handlers(), sizeof(zend_object_handlers));
/* Re-assign default handler previously removed in phongo.c */
phongo_handler_minkey.clone_obj = zend_objects_clone_obj;
phongo_handler_minkey.free_obj = phongo_minkey_free_object;
phongo_handler_minkey.offset = XtOffsetOf(phongo_minkey_t, std);
phongo_minkey_ce = register_class_MongoDB_BSON_MinKey(phongo_minkey_interface_ce, phongo_json_serializable_ce, phongo_type_ce);
}
5 changes: 3 additions & 2 deletions src/phongo_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ PHONGO_DECLARE_CLASS_WITH_HELPERS(DBPOINTER, dbpointer)
PHONGO_DECLARE_CLASS_WITH_HELPERS(DECIMAL128, decimal128)
PHONGO_DECLARE_CLASS_WITH_HELPERS(INT64, int64)
PHONGO_DECLARE_CLASS_WITH_HELPERS(JAVASCRIPT, javascript)
PHONGO_DECLARE_CLASS_WITH_HELPERS(MAXKEY, maxkey)
PHONGO_DECLARE_CLASS_WITH_HELPERS(MINKEY, minkey)
PHONGO_DECLARE_CLASS_WITH_HELPERS(OBJECTID, objectid)
PHONGO_DECLARE_CLASS_WITH_HELPERS(PACKEDARRAY, packedarray)
PHONGO_DECLARE_CLASS_WITH_HELPERS(SYMBOL, symbol)
Expand Down Expand Up @@ -186,6 +184,9 @@ PHONGO_DECLARE_CLASS(unserializable)
PHONGO_DECLARE_CLASS(serializable)
PHONGO_DECLARE_CLASS(vectortype)

PHONGO_DECLARE_CLASS(maxkey)
PHONGO_DECLARE_CLASS(minkey)

PHONGO_DECLARE_CLASS(binary_interface)
PHONGO_DECLARE_CLASS(decimal128_interface)
PHONGO_DECLARE_CLASS(javascript_interface)
Expand Down
8 changes: 0 additions & 8 deletions src/phongo_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,6 @@ typedef struct {
zend_object std;
} phongo_javascript_t;

typedef struct {
zend_object std;
} phongo_maxkey_t;

typedef struct {
zend_object std;
} phongo_minkey_t;

typedef struct {
bool initialized;
char oid[25];
Expand Down
Loading