X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=missing.c;h=99ec620c095c4b6877046e3b511a6a1129c0d9d6;hp=102fb4f7540d8c023d592baad33f91176e5e330e;hb=76d019d55561c397209d49f7d594f2cfe022cdf9;hpb=7750286b889f7d265a5363546b9bfc5b58246277 diff --git a/missing.c b/missing.c index 102fb4f..99ec620 100644 --- a/missing.c +++ b/missing.c @@ -43,6 +43,7 @@ static inline zval *tmp_zval(void) #if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION == 0) + int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC) { zval *property = new_zval(ce); @@ -71,7 +72,7 @@ void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name zend_update_property(scope, object, name, name_length, tmp TSRMLS_CC); } -#endif +#endif /* PHP_VERSION == 5.0 */ #if (PHP_MAJOR_VERSION >= 5) @@ -125,16 +126,12 @@ int zend_update_static_property(zend_class_entry *scope, char *name, size_t name zend_class_entry *old_scope = EG(scope); EG(scope) = scope; - if (!(property = zend_std_get_static_property(scope, name, name_len, 0 TSRMLS_CC))) { - EG(scope) = old_scope; - return FAILURE; - } - EG(scope) = old_scope; - if (*property == value) { - return SUCCESS; - } - if (scope->type & ZEND_INTERNAL_CLASS) { + if (!(property = zend_std_get_static_property(scope, name, name_len, 0 TSRMLS_CC))) { + retval = FAILURE; + } else if (*property == value) { + retval = SUCCESS; + } else if (scope->type & ZEND_INTERNAL_CLASS) { int refcount; zend_uchar is_ref; @@ -228,7 +225,7 @@ int zend_update_static_property(zend_class_entry *scope, char *name, size_t name SEPARATE_ZVAL(&value); } - retval = zend_hash_update(scope->static_members, name, name_len+1, &value, sizeof(zval *), NULL); + retval = zend_hash_update(scope->static_members, name, name_len, &value, sizeof(zval *), NULL); } } @@ -237,6 +234,8 @@ int zend_update_static_property(zend_class_entry *scope, char *name, size_t name FREE_ZVAL(value); } + EG(scope) = old_scope; + return retval; } @@ -275,8 +274,8 @@ int zend_update_static_property_stringl(zend_class_entry *scope, char *name, siz return zend_update_static_property(scope, name, name_len, tmp TSRMLS_CC); } -#endif -#endif +#endif /* PHP_MAJOR_VERSION >= 5 */ +#endif /* ZEND_ENGINE_2 */ /* * Local variables: