]> granicus.if.org Git - php/commitdiff
API change for read_property:
authorStanislav Malyshev <stas@php.net>
Sun, 21 Mar 2004 18:07:27 +0000 (18:07 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 21 Mar 2004 18:07:27 +0000 (18:07 +0000)
instead of bool silent it now gets fetch type
This can be used for creating proxy objects for write contexts

Zend/zend_execute.c
Zend/zend_object_handlers.c
Zend/zend_object_handlers.h

index f4189c485a1efdb09f65abde56fe033b2694c975..76e33ca005f8630e1fe727b469cd0df00ea8ec14 100644 (file)
@@ -178,7 +178,7 @@ static inline void zend_fetch_property_address_inner(zval *object, znode *op2, z
                }
                T(result->u.var).var.ptr_ptr = ptr_ptr;
        } else if (Z_OBJ_HT_P(object)->read_property) {
-               T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, 0 TSRMLS_CC);
+               T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, BP_VAR_W TSRMLS_CC);
                T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr;
        } else {
                zend_error(E_WARNING, "This object doesn't support property references");
@@ -1100,7 +1100,7 @@ static void zend_fetch_property_address_read(znode *result, znode *op1, znode *o
                }
 
                /* here we are sure we are dealing with an object */
-               *retval = Z_OBJ_HT_P(container)->read_property(container, offset, (zend_bool) ((type==BP_VAR_IS) ? 1 : 0) TSRMLS_CC);
+               *retval = Z_OBJ_HT_P(container)->read_property(container, offset, type TSRMLS_CC);
                if (offset == &tmp) {
                        zval_dtor(offset);
                }
@@ -1151,7 +1151,7 @@ static void zend_pre_incdec_property(znode *result, znode *op1, znode *op2, temp
        }
 
        if (!have_get_ptr) {
-               zval *z = Z_OBJ_HT_P(object)->read_property(object, property, 0 TSRMLS_CC);
+               zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC);
 
                if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
                        zval *value = Z_OBJ_HT_P(z)->get(z TSRMLS_CC);
@@ -1209,7 +1209,7 @@ static void zend_post_incdec_property(znode *result, znode *op1, znode *op2, tem
        }
 
        if (!have_get_ptr) {
-               zval *z = Z_OBJ_HT_P(object)->read_property(object, property, 0 TSRMLS_CC);
+               zval *z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC);
 
                if (z->type == IS_OBJECT && Z_OBJ_HT_P(object)->get) {
                        zval *value = Z_OBJ_HT_P(object)->get(z TSRMLS_CC);
@@ -1624,10 +1624,10 @@ static inline int zend_binary_assign_op_obj_helper(int (*binary_op)(zval *result
                        
                        switch (opline->extended_value) {
                                case ZEND_ASSIGN_OBJ:
-                                       z = Z_OBJ_HT_P(object)->read_property(object, property, 0 TSRMLS_CC);
+                                       z = Z_OBJ_HT_P(object)->read_property(object, property, BP_VAR_RW TSRMLS_CC);
                                        break;
                                case ZEND_ASSIGN_DIM:
-                                       z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_W TSRMLS_CC);
+                                       z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_RW TSRMLS_CC);
                                        break;
                        }
                        if (z->type == IS_OBJECT && Z_OBJ_HT_P(z)->get) {
index 1812a31aa41c81701e4e832ebd26f3ccdcfae941..a27fdf623ba025ff47bb90f1ab9118caa46ca298 100644 (file)
@@ -261,14 +261,16 @@ ZEND_API int zend_check_property_access(zend_object *zobj, char *prop_info_name
        return zend_verify_property_access(property_info, zobj->ce TSRMLS_CC) ? SUCCESS : FAILURE;
 }
 
-zval *zend_std_read_property(zval *object, zval *member, zend_bool silent TSRMLS_DC)
+zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
 {
        zend_object *zobj;
        zval tmp_member;
        zval **retval;
        zval *rv = NULL;
        zend_property_info *property_info;
-       
+       int silent;
+
+       silent = (type == BP_VAR_IS);
        zobj = Z_OBJ_P(object);
 
        if (member->type != IS_STRING) {
index a9ad231fb8bbd98d8df62e6adfe7b83b7ef5cd5f..89c4b069238e130afbd48a28cc94ef824595f087 100644 (file)
@@ -29,7 +29,7 @@ union _zend_function;
    symbol table, its reference count should be 0.
 */
 /* Used to fetch property from the object, read-only */
-typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, zend_bool silent TSRMLS_DC);
+typedef zval *(*zend_object_read_property_t)(zval *object, zval *member, int type TSRMLS_DC);
 
 /* Used to fetch dimension from the object, read-only */
 typedef zval *(*zend_object_read_dimension_t)(zval *object, zval *offset, int type TSRMLS_DC);