Skip to content

Commit

Permalink
Using zend functions when updating/reading static properties
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgutierrez committed Oct 18, 2014
1 parent c91a265 commit bd579fd
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ext/kernel/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,7 @@ static int zephir_update_static_property_ex(zend_class_entry *scope, const char
}
}

#if PHP_VERSION_ID < 50600
EG(scope) = scope;
#if PHP_VERSION_ID < 50400
property = zend_std_get_static_property(scope, name, name_length, 0 TSRMLS_CC);
Expand Down Expand Up @@ -1592,16 +1593,27 @@ static int zephir_update_static_property_ex(zend_class_entry *scope, const char
}
return SUCCESS;
}
#else
return zend_update_static_property(scope, name, name_length, value TSRMLS_DC);
#endif
}

/**
* Query a static property value from a zend_class_entry
*/
int zephir_read_static_property(zval **result, const char *class_name, unsigned int class_length, char *property_name,
unsigned int property_length TSRMLS_DC){
unsigned int property_length TSRMLS_DC) {
zend_class_entry **ce;
if (zend_lookup_class(class_name, class_length, &ce TSRMLS_CC) == SUCCESS) {
#if PHP_VERSION_ID < 50600
return zephir_read_static_property_ce(result, *ce, property_name, property_length TSRMLS_CC);
#else
*result = zend_read_static_property(*ce, property_name, property_length, 1 TSRMLS_DC);
if (*result) {
Z_ADDREF_PP(result);
return SUCCESS;
}
#endif
}
return FAILURE;
}
Expand Down Expand Up @@ -1848,7 +1860,6 @@ int zephir_update_static_property(const char *class_name, unsigned int class_len
if (zend_lookup_class(class_name, class_length, &ce TSRMLS_CC) == SUCCESS) {
return zend_update_static_property(*ce, name, name_length, value TSRMLS_CC);
}

return FAILURE;
}

Expand Down

4 comments on commit bd579fd

@nkt
Copy link
Contributor

@nkt nkt commented on bd579fd Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ovr great release.
Please when master builds will be passed, update Compiler::VERSION.

@ovr
Copy link
Contributor

@ovr ovr commented on bd579fd Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkt
You suggest to rebase commits with force mod to push version?

this commmit bd579fd#commitcomment-8210970

andresgutierrez authored 10 hours ago

my release

ovr created tag 0.5.3 at phalcon/zephir  5 hours ago

2a067f4

 phalcon authored 8 hours ago

Think more

@nkt
Copy link
Contributor

@nkt nkt commented on bd579fd Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ovr
Copy link
Contributor

@ovr ovr commented on bd579fd Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.