|
|
|
@ -179,6 +179,8 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{ |
|
|
|
{ |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(object); |
|
|
|
zend_class_entry *orig_fake_scope = EG(fake_scope); |
|
|
|
zend_fcall_info fci; |
|
|
|
zend_fcall_info_cache fcic; |
|
|
|
|
|
|
|
EG(fake_scope) = NULL; |
|
|
|
|
|
|
|
@ -187,7 +189,20 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{ |
|
|
|
|
|
|
|
it should return whether the call was successful or not |
|
|
|
*/ |
|
|
|
zend_call_method_with_1_params(object, ce, &ce->__get, ZEND_GET_FUNC_NAME, retval, member); |
|
|
|
|
|
|
|
fci.size = sizeof(fci); |
|
|
|
fci.object = Z_OBJ_P(object); |
|
|
|
fci.retval = retval; |
|
|
|
fci.param_count = 1; |
|
|
|
fci.params = member; |
|
|
|
fci.no_separation = 1; |
|
|
|
ZVAL_UNDEF(&fci.function_name); /* Unused */ |
|
|
|
|
|
|
|
fcic.function_handler = ce->__get; |
|
|
|
fcic.called_scope = ce; |
|
|
|
fcic.object = Z_OBJ_P(object); |
|
|
|
|
|
|
|
zend_call_function(&fci, &fcic); |
|
|
|
|
|
|
|
EG(fake_scope) = orig_fake_scope; |
|
|
|
} |
|
|
|
@ -197,6 +212,9 @@ static void zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{ |
|
|
|
{ |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(object); |
|
|
|
zend_class_entry *orig_fake_scope = EG(fake_scope); |
|
|
|
zend_fcall_info fci; |
|
|
|
zend_fcall_info_cache fcic; |
|
|
|
zval args[2], ret; |
|
|
|
|
|
|
|
EG(fake_scope) = NULL; |
|
|
|
|
|
|
|
@ -204,7 +222,25 @@ static void zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{ |
|
|
|
property name |
|
|
|
value to be set |
|
|
|
*/ |
|
|
|
zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, NULL, member, value); |
|
|
|
|
|
|
|
ZVAL_COPY_VALUE(&args[0], member); |
|
|
|
ZVAL_COPY_VALUE(&args[1], value); |
|
|
|
ZVAL_UNDEF(&ret); |
|
|
|
|
|
|
|
fci.size = sizeof(fci); |
|
|
|
fci.object = Z_OBJ_P(object); |
|
|
|
fci.retval = &ret; |
|
|
|
fci.param_count = 2; |
|
|
|
fci.params = args; |
|
|
|
fci.no_separation = 1; |
|
|
|
ZVAL_UNDEF(&fci.function_name); /* Unused */ |
|
|
|
|
|
|
|
fcic.function_handler = ce->__set; |
|
|
|
fcic.called_scope = ce; |
|
|
|
fcic.object = Z_OBJ_P(object); |
|
|
|
|
|
|
|
zend_call_function(&fci, &fcic); |
|
|
|
zval_ptr_dtor(&ret); |
|
|
|
|
|
|
|
EG(fake_scope) = orig_fake_scope; |
|
|
|
} |
|
|
|
@ -214,6 +250,9 @@ static void zend_std_call_unsetter(zval *object, zval *member) /* {{{ */ |
|
|
|
{ |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(object); |
|
|
|
zend_class_entry *orig_fake_scope = EG(fake_scope); |
|
|
|
zend_fcall_info fci; |
|
|
|
zend_fcall_info_cache fcic; |
|
|
|
zval ret; |
|
|
|
|
|
|
|
EG(fake_scope) = NULL; |
|
|
|
|
|
|
|
@ -221,7 +260,22 @@ static void zend_std_call_unsetter(zval *object, zval *member) /* {{{ */ |
|
|
|
property name |
|
|
|
*/ |
|
|
|
|
|
|
|
zend_call_method_with_1_params(object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member); |
|
|
|
ZVAL_UNDEF(&ret); |
|
|
|
|
|
|
|
fci.size = sizeof(fci); |
|
|
|
fci.object = Z_OBJ_P(object); |
|
|
|
fci.retval = &ret; |
|
|
|
fci.param_count = 1; |
|
|
|
fci.params = member; |
|
|
|
fci.no_separation = 1; |
|
|
|
ZVAL_UNDEF(&fci.function_name); /* Unused */ |
|
|
|
|
|
|
|
fcic.function_handler = ce->__unset; |
|
|
|
fcic.called_scope = ce; |
|
|
|
fcic.object = Z_OBJ_P(object); |
|
|
|
|
|
|
|
zend_call_function(&fci, &fcic); |
|
|
|
zval_ptr_dtor(&ret); |
|
|
|
|
|
|
|
EG(fake_scope) = orig_fake_scope; |
|
|
|
} |
|
|
|
@ -231,6 +285,8 @@ static void zend_std_call_issetter(zval *object, zval *member, zval *retval) /* |
|
|
|
{ |
|
|
|
zend_class_entry *ce = Z_OBJCE_P(object); |
|
|
|
zend_class_entry *orig_fake_scope = EG(fake_scope); |
|
|
|
zend_fcall_info fci; |
|
|
|
zend_fcall_info_cache fcic; |
|
|
|
|
|
|
|
EG(fake_scope) = NULL; |
|
|
|
|
|
|
|
@ -240,7 +296,19 @@ static void zend_std_call_issetter(zval *object, zval *member, zval *retval) /* |
|
|
|
it should return whether the property is set or not |
|
|
|
*/ |
|
|
|
|
|
|
|
zend_call_method_with_1_params(object, ce, &ce->__isset, ZEND_ISSET_FUNC_NAME, retval, member); |
|
|
|
fci.size = sizeof(fci); |
|
|
|
fci.object = Z_OBJ_P(object); |
|
|
|
fci.retval = retval; |
|
|
|
fci.param_count = 1; |
|
|
|
fci.params = member; |
|
|
|
fci.no_separation = 1; |
|
|
|
ZVAL_UNDEF(&fci.function_name); /* Unused */ |
|
|
|
|
|
|
|
fcic.function_handler = ce->__isset; |
|
|
|
fcic.called_scope = ce; |
|
|
|
fcic.object = Z_OBJ_P(object); |
|
|
|
|
|
|
|
zend_call_function(&fci, &fcic); |
|
|
|
|
|
|
|
EG(fake_scope) = orig_fake_scope; |
|
|
|
} |
|
|
|
|