PHP_ME_MAPPING(getRules, rbbi_get_rules, ainfo_biter_void, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(getRuleStatus, rbbi_get_rule_status, ainfo_biter_void, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(getRuleStatusVec, rbbi_get_rule_status_vec, ainfo_biter_void, ZEND_ACC_PUBLIC)
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
PHP_ME_MAPPING(getBinaryRules, rbbi_get_binary_rules, ainfo_biter_void, ZEND_ACC_PUBLIC)
+#endif
PHP_FE_END
};
/* }}} */
/* {{{ breakiterator_register_BreakIterator_class
* Initialize 'BreakIterator' class
*/
-void breakiterator_register_BreakIterator_class(TSRMLS_D)
+U_CFUNC void breakiterator_register_BreakIterator_class(TSRMLS_D)
{
zend_class_entry ce;
{
UBool res = utext_moveIndex32(this->fText, n);
+#ifndef UTEXT_CURRENT32
+#define UTEXT_CURRENT32 utext_current32
+#endif
+
if (res) {
this->lastCodePoint = UTEXT_CURRENT32(this->fText);
return (int32_t)UTEXT_GETNATIVEINDEX(this->fText);
RETURN_NULL();
}
} else { // compiled
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
rbbi = new RuleBasedBreakIterator((uint8_t*)rules, rules_len, status);
if (U_FAILURE(status)) {
intl_error_set(NULL, status, "rbbi_create_instance: unable to "
"creaete instance from compiled rules", 0 TSRMLS_CC);
RETURN_NULL();
}
+#else
+ intl_error_set(NULL, U_UNSUPPORTED_ERROR, "rbbi_create_instance: "
+ "compiled rules require ICU >= 4.8", 0 TSRMLS_CC);
+ RETURN_NULL();
+#endif
}
breakiterator_object_create(return_value, rbbi TSRMLS_CC);
delete[] rules;
}
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
U_CFUNC PHP_FUNCTION(rbbi_get_binary_rules)
{
BREAKITER_METHOD_INIT_VARS;
RETURN_STRINGL(ret_rules, rules_len, 0);
}
+#endif
--TEST--
IntlRuleBasedBreakIterator::__construct(): arg errors
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
--TEST--
IntlRuleBasedBreakIterator::getBinaryRules(): basic test
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
string(128) "$LN = [[:letter:] [:number:]];$S = [.;,:];!!forward;$LN+ {1};$S+ {42};!!reverse;$LN+ {1};$S+ {42};!!safe_forward;!!safe_reverse;"
string(128) "$LN = [[:letter:] [:number:]];$S = [.;,:];!!forward;$LN+ {1};$S+ {42};!!reverse;$LN+ {1};$S+ {42};!!safe_forward;!!safe_reverse;"
bool(true)
-==DONE==
\ No newline at end of file
+==DONE==