diff options
Diffstat (limited to 'ext/intl/php_intl.c')
-rwxr-xr-x | ext/intl/php_intl.c | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 831ace4d5..a9bfefd14 100755 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -62,6 +62,8 @@ #include "dateformat/dateformat_parse.h" #include "dateformat/dateformat_data.h" +#include "resourcebundle/resourcebundle_class.h" + #include "idn/idn.h" #include "msgformat/msgformat.h" @@ -74,11 +76,11 @@ #define INTL_MODULE_VERSION PHP_INTL_VERSION /* - * locale_get_default has a conflict since ICU also has + * locale_get_default has a conflict since ICU also has * a function with the same name * in fact ICU appends the version no. to it also * Hence the following undef for ICU version - * Same true for the locale_set_default function + * Same true for the locale_set_default function */ #undef locale_get_default #undef locale_set_default @@ -330,6 +332,36 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_idn_to_utf8, 0, 0, 1) ZEND_ARG_INFO(0, option) ZEND_ARG_INFO(0, status) ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_create_proc, 0, 0, 2 ) + ZEND_ARG_INFO( 0, locale ) + ZEND_ARG_INFO( 0, bundlename ) + ZEND_ARG_INFO( 0, fallback ) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_proc, 0, 0, 2 ) + ZEND_ARG_INFO( 0, bundle ) + ZEND_ARG_INFO( 0, index ) + ZEND_ARG_INFO( 0, fallback ) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_count_proc, 0, 0, 1 ) + ZEND_ARG_INFO( 0, bundle ) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_locales_proc, 0, 0, 1 ) + ZEND_ARG_INFO( 0, bundlename ) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_code_proc, 0, 0, 1 ) + ZEND_ARG_INFO( 0, bundle ) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_message_proc, 0, 0, 1 ) + ZEND_ARG_INFO( 0, bundle ) +ZEND_END_ARG_INFO() + + /* }}} */ /* {{{ intl_functions @@ -351,6 +383,7 @@ zend_function_entry intl_functions[] = { PHP_FE( collator_get_locale, collator_1_arg ) PHP_FE( collator_get_error_code, collator_0_args ) PHP_FE( collator_get_error_message, collator_0_args ) + PHP_FE( collator_get_sort_key, collator_2_args ) /* formatter functions */ PHP_FE( numfmt_create, arginfo_numfmt_create ) @@ -421,7 +454,7 @@ zend_function_entry intl_functions[] = { PHP_FE( datefmt_set_lenient, arginfo_msgfmt_get_locale ) PHP_FE( datefmt_format, arginfo_datefmt_format ) PHP_FE( datefmt_parse, datefmt_parse_args ) - PHP_FE( datefmt_localtime , datefmt_parse_args ) + PHP_FE( datefmt_localtime , datefmt_parse_args ) PHP_FE( datefmt_get_error_code, arginfo_msgfmt_get_error_code ) PHP_FE( datefmt_get_error_message, arginfo_msgfmt_get_error_message ) @@ -437,8 +470,16 @@ zend_function_entry intl_functions[] = { PHP_FE( grapheme_extract, grapheme_extract_args ) /* IDN functions */ - PHP_FE(idn_to_ascii, arginfo_idn_to_ascii) - PHP_FE(idn_to_utf8, arginfo_idn_to_ascii) + PHP_FE( idn_to_ascii, arginfo_idn_to_ascii) + PHP_FE( idn_to_utf8, arginfo_idn_to_ascii) + + /* ResourceBundle functions */ + PHP_FE( resourcebundle_create, arginfo_resourcebundle_create_proc ) + PHP_FE( resourcebundle_get, arginfo_resourcebundle_get_proc ) + PHP_FE( resourcebundle_count, arginfo_resourcebundle_count_proc ) + PHP_FE( resourcebundle_locales, arginfo_resourcebundle_locales_proc ) + PHP_FE( resourcebundle_get_error_code, arginfo_resourcebundle_get_error_code_proc ) + PHP_FE( resourcebundle_get_error_message, arginfo_resourcebundle_get_error_message_proc ) /* common functions */ PHP_FE( intl_get_error_code, intl_0_args ) @@ -520,7 +561,7 @@ PHP_MINIT_FUNCTION( intl ) /* Expose Normalizer constants to PHP scripts */ normalizer_register_constants( INIT_FUNC_ARGS_PASSTHRU ); - + /* Register 'Locale' PHP class */ locale_register_Locale_class( TSRMLS_C ); @@ -537,6 +578,9 @@ PHP_MINIT_FUNCTION( intl ) /* Expose DateFormat constants to PHP scripts */ dateformat_register_constants( INIT_FUNC_ARGS_PASSTHRU ); + /* Register 'ResourceBundle' PHP class */ + resourcebundle_register_class( TSRMLS_C); + /* Expose ICU error codes to PHP scripts. */ intl_expose_icu_error_codes( INIT_FUNC_ARGS_PASSTHRU ); |