mirror of
https://github.com/php/php-src.git
synced 2026-04-24 08:28:26 +02:00
- Export zend_user_(un)serialize functions to be used by custom callbacks
- Transfer custom (un)serialize callbacks through inheritance
This commit is contained in:
@@ -2891,6 +2891,10 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
|
||||
/* Inherit interfaces */
|
||||
zend_do_inherit_interfaces(ce, parent_ce TSRMLS_CC);
|
||||
|
||||
/* Copy serialize/unserialize callbacks */
|
||||
ce->serialize = parent_ce->serialize;
|
||||
ce->unserialize = parent_ce->unserialize;
|
||||
|
||||
/* Inherit properties */
|
||||
zend_hash_merge(&ce->default_properties, &parent_ce->default_properties, (void (*)(void *)) zval_add_ref, NULL, sizeof(zval *), 0);
|
||||
if (parent_ce->type != ce->type) {
|
||||
|
||||
@@ -412,7 +412,7 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en
|
||||
/* }}}*/
|
||||
|
||||
/* {{{ zend_user_serialize */
|
||||
int zend_user_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC)
|
||||
ZEND_API int zend_user_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC)
|
||||
{
|
||||
zend_class_entry * ce = Z_OBJCE_P(object);
|
||||
zval *retval;
|
||||
@@ -450,7 +450,7 @@ int zend_user_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_le
|
||||
/* }}} */
|
||||
|
||||
/* {{{ zend_user_unserialize */
|
||||
int zend_user_unserialize(zval **object, zend_class_entry *ce, int type, const zstr buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC)
|
||||
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, int type, const zstr buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC)
|
||||
{
|
||||
zval * zdata;
|
||||
|
||||
|
||||
@@ -66,6 +66,9 @@ ZEND_API zend_object_iterator *zend_user_it_get_new_iterator(zend_class_entry *c
|
||||
|
||||
ZEND_API void zend_register_interfaces(TSRMLS_D);
|
||||
|
||||
ZEND_API int zend_user_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC);
|
||||
ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, int type, const zstr buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif /* ZEND_INTERFACES_H */
|
||||
|
||||
Reference in New Issue
Block a user