Download src/php/php-src/ext/intl/php_intl.c from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 7.69 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/intl/php_intl.c
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/intl/php_intl.c
-
curl -L -o php_intl.c https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/intl/php_intl.c
7.69 kB
| /* | |
| +----------------------------------------------------------------------+ | |
| | This source file is subject to version 3.01 of the PHP license, | | |
| | that is bundled with this package in the file LICENSE, and is | | |
| | available through the world-wide-web at the following url: | | |
| | https://www.php.net/license/3_01.txt | | |
| | If you did not receive a copy of the PHP license and are unable to | | |
| | obtain it through the world-wide-web, please send a note to | | |
| | license@php.net so we can mail you a copy immediately. | | |
| +----------------------------------------------------------------------+ | |
| | Authors: Vadim Savchuk <vsavchuk@productengine.com> | | |
| | Dmitry Lakhtyuk <dlakhtyuk@productengine.com> | | |
| | Stanislav Malyshev <stas@zend.com> | | |
| | Kirti Velankar <kirtig@yahoo-inc.com> | | |
| +----------------------------------------------------------------------+ | |
| */ | |
| /* | |
| * 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 | |
| */ | |
| ZEND_DECLARE_MODULE_GLOBALS( intl ) | |
| const char *intl_locale_get_default( void ) | |
| { | |
| if( INTL_G(default_locale) == NULL ) { | |
| return uloc_getDefault(); | |
| } | |
| return INTL_G(default_locale); | |
| } | |
| /* {{{ INI Settings */ | |
| PHP_INI_BEGIN() | |
| STD_PHP_INI_ENTRY(LOCALE_INI_NAME, NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_locale, zend_intl_globals, intl_globals) | |
| STD_PHP_INI_ENTRY("intl.error_level", "0", PHP_INI_ALL, OnUpdateLong, error_level, zend_intl_globals, intl_globals) | |
| STD_PHP_INI_BOOLEAN("intl.use_exceptions", "0", PHP_INI_ALL, OnUpdateBool, use_exceptions, zend_intl_globals, intl_globals) | |
| PHP_INI_END() | |
| /* }}} */ | |
| static PHP_GINIT_FUNCTION(intl); | |
| /* {{{ intl_module_entry */ | |
| zend_module_entry intl_module_entry = { | |
| STANDARD_MODULE_HEADER, | |
| "intl", | |
| ext_functions, | |
| PHP_MINIT( intl ), | |
| PHP_MSHUTDOWN( intl ), | |
| PHP_RINIT( intl ), | |
| PHP_RSHUTDOWN( intl ), | |
| PHP_MINFO( intl ), | |
| PHP_INTL_VERSION, | |
| PHP_MODULE_GLOBALS(intl), /* globals descriptor */ | |
| PHP_GINIT(intl), /* globals ctor */ | |
| NULL, /* globals dtor */ | |
| NULL, /* post deactivate */ | |
| STANDARD_MODULE_PROPERTIES_EX | |
| }; | |
| /* }}} */ | |
| ZEND_TSRMLS_CACHE_DEFINE() | |
| ZEND_GET_MODULE( intl ) | |
| /* {{{ intl_init_globals */ | |
| static PHP_GINIT_FUNCTION(intl) | |
| { | |
| ZEND_TSRMLS_CACHE_UPDATE(); | |
| memset( intl_globals, 0, sizeof(zend_intl_globals) ); | |
| } | |
| /* }}} */ | |
| /* {{{ PHP_MINIT_FUNCTION */ | |
| PHP_MINIT_FUNCTION( intl ) | |
| { | |
| /* For the default locale php.ini setting */ | |
| REGISTER_INI_ENTRIES(); | |
| register_php_intl_symbols(module_number); | |
| /* Register collator symbols and classes */ | |
| collator_register_Collator_symbols(module_number); | |
| /* Register 'NumberFormatter' PHP class */ | |
| formatter_register_class( ); | |
| /* Register 'ListFormatter' PHP class */ | |
| listformatter_register_class( ); | |
| /* Register 'Normalizer' PHP class */ | |
| normalizer_register_Normalizer_class( ); | |
| /* Register 'Locale' PHP class */ | |
| locale_register_Locale_class( ); | |
| msgformat_register_class(); | |
| /* Register 'DateFormat' PHP class */ | |
| dateformat_register_IntlDateFormatter_class( ); | |
| /* Register 'IntlDateTimeFormatter' PHP class */ | |
| dateformat_register_IntlDatePatternGenerator_class( ); | |
| /* Register 'ResourceBundle' PHP class */ | |
| resourcebundle_register_class( ); | |
| /* Register 'Transliterator' PHP class */ | |
| transliterator_register_Transliterator_class( ); | |
| /* Register 'IntlTimeZone' PHP class */ | |
| timezone_register_IntlTimeZone_class( ); | |
| /* Register 'IntlCalendar' PHP class */ | |
| calendar_register_IntlCalendar_class( ); | |
| /* Register 'Spoofchecker' PHP class */ | |
| spoofchecker_register_Spoofchecker_class( ); | |
| /* Register 'IntlException' PHP class */ | |
| IntlException_ce_ptr = register_class_IntlException(zend_ce_exception); | |
| IntlException_ce_ptr->create_object = zend_ce_exception->create_object; | |
| /* Register common symbols and classes */ | |
| intl_register_common_symbols(module_number); | |
| /* Register 'BreakIterator' class */ | |
| breakiterator_register_BreakIterator_class( ); | |
| /* Register 'IntlPartsIterator' class */ | |
| breakiterator_register_IntlPartsIterator_class(); | |
| /* Global error handling. */ | |
| intl_error_init( NULL ); | |
| /* 'Converter' class for codepage conversions */ | |
| php_converter_minit(INIT_FUNC_ARGS_PASSTHRU); | |
| /* IntlChar class */ | |
| php_uchar_minit(INIT_FUNC_ARGS_PASSTHRU); | |
| return SUCCESS; | |
| } | |
| /* }}} */ | |
| /* {{{ PHP_MSHUTDOWN_FUNCTION */ | |
| PHP_MSHUTDOWN_FUNCTION( intl ) | |
| { | |
| const char *cleanup; | |
| /* For the default locale php.ini setting */ | |
| UNREGISTER_INI_ENTRIES(); | |
| cleanup = getenv(EXPLICIT_CLEANUP_ENV_VAR); | |
| if (cleanup != NULL && !(cleanup[0] == '0' && cleanup[1] == '\0')) { | |
| u_cleanup(); | |
| } | |
| return SUCCESS; | |
| } | |
| /* }}} */ | |
| /* {{{ PHP_RINIT_FUNCTION */ | |
| PHP_RINIT_FUNCTION( intl ) | |
| { | |
| return SUCCESS; | |
| } | |
| /* }}} */ | |
| /* {{{ PHP_RSHUTDOWN_FUNCTION */ | |
| PHP_RSHUTDOWN_FUNCTION( intl ) | |
| { | |
| INTL_G(current_collator) = NULL; | |
| if (INTL_G(grapheme_iterator)) { | |
| grapheme_close_global_iterator( ); | |
| INTL_G(grapheme_iterator) = NULL; | |
| } | |
| intl_error_reset( NULL); | |
| return SUCCESS; | |
| } | |
| /* }}} */ | |
| /* {{{ PHP_MINFO_FUNCTION */ | |
| PHP_MINFO_FUNCTION( intl ) | |
| { | |
| UErrorCode status = U_ZERO_ERROR; | |
| const char *tzdata_ver = NULL; | |
| php_info_print_table_start(); | |
| php_info_print_table_row( 2, "Internationalization support", "enabled" ); | |
| php_info_print_table_row( 2, "ICU version", U_ICU_VERSION ); | |
| php_info_print_table_row( 2, "ICU Data version", U_ICU_DATA_VERSION ); | |
| tzdata_ver = ucal_getTZDataVersion(&status); | |
| if (U_ZERO_ERROR == status) { | |
| php_info_print_table_row( 2, "ICU TZData version", tzdata_ver); | |
| } | |
| php_info_print_table_row( 2, "ICU Unicode version", U_UNICODE_VERSION ); | |
| php_info_print_table_end(); | |
| /* For the default locale php.ini setting */ | |
| DISPLAY_INI_ENTRIES() ; | |
| } | |
| /* }}} */ | |