diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-04-01 12:11:13 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-04-01 12:11:13 +0300 |
commit | 4796e0242b8cdd2a77b552fcbaa74d70d87f6d0a (patch) | |
tree | 0881d7c1a1775deb840ded202edc2c1de6e9abd6 /ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp | |
parent | 52fcc74875b26a2d7000af23c1705516280a7634 (diff) | |
parent | 2afca9f179fca2e127d5da3e1cc6cf50ff47339c (diff) | |
download | php-git-4796e0242b8cdd2a77b552fcbaa74d70d87f6d0a.tar.gz |
Merge branch 'InternalClassClean'
* InternalClassClean:
Fixed test
Patch improvement:
Fixed indentation. Fixed comment style. Fixed commented out code.
Reverted change to function name and added note of why it is different from the class it is actually changing.
Made UConverter throw an exception if the constructor fails.
Fixed PDO constructor to not return null.
Fixed fileinfo behaviour.
Made Phar throw exception on bad constructor.
Converted intl extension to use IntlException in constructors.
Fixed SplFixedArray and tests.
Fixed ReflectionExtension and ReflectionProperty.
Fixed ReflectionFunction, ReflectionMethod and ReflectionParameter.
Fixed PDORow behaviour and message.
Diffstat (limited to 'ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp')
-rw-r--r-- | ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp index c112134124..b43f8212d0 100644 --- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp +++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp @@ -24,6 +24,7 @@ extern "C" { } #include "../intl_convertcpp.h" +#include "../intl_common.h" static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) { return (RuleBasedBreakIterator*)bio->biter; @@ -97,15 +98,17 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS) U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct) { - zval orig_this = *getThis(); + zend_error_handling error_handling; + zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling); return_value = getThis(); _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU); - if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) { - zend_object_store_ctor_failed(Z_OBJ(orig_this)); - ZEND_CTOR_MAKE_NULL(); + if (!EG(exception)) { + zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0); + } } + zend_restore_error_handling(&error_handling); } U_CFUNC PHP_FUNCTION(rbbi_get_rules) |