diff options
author | Anatol Belski <ab@php.net> | 2014-10-10 22:51:13 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-10-10 22:51:13 +0200 |
commit | e1cd0e0a38deb91d24ded68df010b7f6c03d2cb6 (patch) | |
tree | 19090152884f17ee4d7691ee79462f4a0537d356 /Zend/zend_objects_API.c | |
parent | fe42847799c9fab9476ca6399e25ed0da0cb2d5c (diff) | |
parent | e33e4b2d8c44fb04afc54f688ed44dce7e8a2e0f (diff) | |
download | php-git-e1cd0e0a38deb91d24ded68df010b7f6c03d2cb6.tar.gz |
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (40 commits)
int to size_t where the underlaying API supports it
use php_socket_t instead of int
fix signed/unsigned mismatch warning
fix compilation warning
Improved specialisation $this variable accessed through IS_UNUSED operand must be IS_OBJECT, so we don't have to check for its type or perform dereference.
Add notes about get_class_entry/get_class_name to UPGRADING
Fix casts in GD
Drop redundant casting code from ext/filter
update NEWS
update NEWS
update NEWS
update NEWS
Added note to UPGRADING regarding 64-bit support in pack()/unpack()
pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG
Add 64 bit formats to pack() and unpack()
Help to CPU branch predictor
Removed unused EG(orig_error_reporting)
Update get_class_name semantics
Remove Z_OBJ_CLASS_NAME_P
Improved VM stack primitives for fast paths. Slow paths are not inlined anymore.
...
Diffstat (limited to 'Zend/zend_objects_API.c')
-rw-r--r-- | Zend/zend_objects_API.c | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 50930df20d..04dd82b6a0 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -219,107 +219,11 @@ ZEND_API void zend_object_store_ctor_failed(zend_object *obj TSRMLS_DC) GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED; } -/* Proxy objects workings */ -typedef struct _zend_proxy_object { - zend_object std; - zval object; - zval property; -} zend_proxy_object; - -static zend_object_handlers zend_object_proxy_handlers; - -ZEND_API void zend_objects_proxy_destroy(zend_object *object TSRMLS_DC) -{ -} - -ZEND_API void zend_objects_proxy_free_storage(zend_proxy_object *object TSRMLS_DC) -{ - zval_ptr_dtor(&object->object); - zval_ptr_dtor(&object->property); - efree(object); -} - -ZEND_API void zend_objects_proxy_clone(zend_proxy_object *object, zend_proxy_object **object_clone TSRMLS_DC) -{ - *object_clone = emalloc(sizeof(zend_proxy_object)); - (*object_clone)->object = object->object; - (*object_clone)->property = object->property; - Z_ADDREF_P(&(*object_clone)->property); - Z_ADDREF_P(&(*object_clone)->object); -} - -ZEND_API zend_object *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC) -{ - zend_proxy_object *obj = emalloc(sizeof(zend_proxy_object)); - - GC_REFCOUNT(obj) = 1; - GC_TYPE_INFO(obj) = IS_OBJECT; - obj->std.ce = NULL; - obj->std.properties = NULL; - obj->std.guards = NULL; - obj->std.handlers = &zend_object_proxy_handlers; - - ZVAL_COPY(&obj->object, object); - ZVAL_DUP(&obj->property, member); - - return (zend_object*)obj; -} - -ZEND_API void zend_object_proxy_set(zval *property, zval *value TSRMLS_DC) -{ - zend_proxy_object *probj = (zend_proxy_object*)Z_OBJ_P(property); - - if (Z_OBJ_HT(probj->object) && Z_OBJ_HT(probj->object)->write_property) { - Z_OBJ_HT(probj->object)->write_property(&probj->object, &probj->property, value, NULL TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot write property of object - no write handler defined"); - } -} - -ZEND_API zval* zend_object_proxy_get(zval *property, zval *rv TSRMLS_DC) -{ - zend_proxy_object *probj = (zend_proxy_object*)Z_OBJ_P(property); - - if (Z_OBJ_HT(probj->object) && Z_OBJ_HT(probj->object)->read_property) { - return Z_OBJ_HT(probj->object)->read_property(&probj->object, &probj->property, BP_VAR_R, NULL, rv TSRMLS_CC); - } else { - zend_error(E_WARNING, "Cannot read property of object - no read handler defined"); - } - - return NULL; -} - ZEND_API zend_object_handlers *zend_get_std_object_handlers(void) { return &std_object_handlers; } -static zend_object_handlers zend_object_proxy_handlers = { - ZEND_OBJECTS_STORE_HANDLERS, - - NULL, /* read_property */ - NULL, /* write_property */ - NULL, /* read dimension */ - NULL, /* write_dimension */ - NULL, /* get_property_ptr_ptr */ - zend_object_proxy_get, /* get */ - zend_object_proxy_set, /* set */ - NULL, /* has_property */ - NULL, /* unset_property */ - NULL, /* has_dimension */ - NULL, /* unset_dimension */ - NULL, /* get_properties */ - NULL, /* get_method */ - NULL, /* call_method */ - NULL, /* get_constructor */ - NULL, /* get_class_entry */ - NULL, /* get_class_name */ - NULL, /* compare_objects */ - NULL, /* cast_object */ - NULL, /* count_elements */ -}; - - /* * Local variables: * tab-width: 4 |