16#include <unicode/ures.h>
17#include <unicode/uenum.h>
38static void ResourceBundle_object_free(
zend_object *
object )
49 ures_close( rb->
child );
78 size_t bundlename_len = 0;
80 size_t locale_len = 0;
95 if (error_handling !=
NULL) {
97 *error_handling_replaced = 1;
107 if (locale ==
NULL) {
128 spprintf(&pbuf, 0,
"resourcebundle_ctor: Cannot load libICU resource "
129 "'%s' without fallback from %s to %s",
130 bundlename ? bundlename :
"(default data)", locale,
131 ures_getLocaleByType(
146 bool error_handling_replaced = 0;
154 if (error_handling_replaced) {
172static zval *resource_bundle_array_fetch(
182 rb = php_intl_resourcebundle_fetch_object(
object);
188 if (offset_arg_num) {
199 if (offset_arg_num) {
206 index = (int32_t)offset_int;
213 spprintf( &pbuf, 0,
"Cannot load resource element %d", index );
215 spprintf( &pbuf, 0,
"Cannot load resource element '%s'",
key );
227 spprintf(&pbuf, 0,
"Cannot load element %d without fallback from to %s", index, locale);
229 spprintf(&pbuf, 0,
"Cannot load element '%s' without fallback from to %s",
key, locale);
254 return resource_bundle_array_fetch(
object,
Z_STR_P(
offset), 0,
rv,
true, 0);
265 bool fallback =
true;
277 zval *
retval = resource_bundle_array_fetch(resource_bundle, offset_str, offset_long,
return_value, fallback, 2);
286 bool fallback =
true;
310 "Found unconstructed ResourceBundle", 0);
314 *
count = ures_getSize( rb->
me );
332 len = ures_getSize( rb->
me );
340 size_t bundlename_len = 0;
343 UEnumeration *icuenum;
357 if(bundlename_len == 0) {
362 icuenum = ures_openAvailableLocales( bundlename, &icuerror );
365 uenum_reset( icuenum, &icuerror );
369 while ((entry = uenum_next( icuenum, &entry_len, &icuerror ))) {
372 uenum_close( icuenum );
429 ResourceBundle_object_handlers.clone_obj =
NULL;
430 ResourceBundle_object_handlers.free_obj = ResourceBundle_object_free;
432 ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
count(Countable|array $value, int $mode=COUNT_NORMAL)
const U_USING_DEFAULT_WARNING
const U_ILLEGAL_ARGUMENT_ERROR
const U_USING_FALLBACK_WARNING
foreach($dp as $el) foreach( $dp as $el) if( $pass2< 2) echo ""
zend_class_entry * IntlException_ce_ptr
#define INTL_DATA_ERROR_P(obj)
#define INTL_CTOR_CHECK_STATUS(obj, msg)
#define INTL_CHECK_STATUS(err, msg)
#define INTL_DATA_ERROR_CODE(obj)
#define INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len)
void intl_errors_set_custom_msg(intl_error *err, const char *msg, int copyMsg)
void intl_error_init(intl_error *err)
void intl_errors_set(intl_error *err, UErrorCode code, const char *msg, int copyMsg)
void intl_error_reset(intl_error *err)
void intl_errors_reset(intl_error *err)
void intl_error_set_code(intl_error *err, UErrorCode err_code)
void intl_errors_set_code(intl_error *err, UErrorCode err_code)
zend_string * intl_error_get_message(intl_error *err)
const char * intl_locale_get_default(void)
resourcebundle_get(ResourceBundle $bundle, string|int $index, bool $fallback=true)
resourcebundle_get_error_message(ResourceBundle $bundle)
resourcebundle_create(?string $locale, ?string $bundle, bool $fallback=true)
resourcebundle_get_error_code(ResourceBundle $bundle)
resourcebundle_locales(string $bundle)
resourcebundle_count(ResourceBundle $bundle)
unsigned char key[REFLECTION_KEY_LEN]
void resourcebundle_extract_value(zval *return_value, ResourceBundle_object *source)
zval * resourcebundle_array_get(zend_object *object, zval *offset, int type, zval *rv)
zend_class_entry * ResourceBundle_ce_ptr
void resourcebundle_register_class(void)
#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT
#define RESOURCEBUNDLE_METHOD_INIT_VARS
#define Z_INTL_RESOURCEBUNDLE_P(zv)
zend_object_iterator * resourcebundle_get_iterator(zend_class_entry *ce, zval *object, int byref)
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format,...)
ZEND_API ZEND_COLD void zend_value_error(const char *format,...)
ZEND_API ZEND_COLD void zend_illegal_container_offset(const zend_string *container, const zval *offset, int type)
#define INTERNAL_FUNCTION_PARAMETERS
ZEND_API void zend_replace_error_handling(zend_error_handling_t error_handling, zend_class_entry *exception_class, zend_error_handling *current)
ZEND_API void zend_restore_error_handling(zend_error_handling *saved)
#define INTERNAL_FUNCTION_PARAM_PASSTHRU
ZEND_API zend_result add_next_index_stringl(zval *arg, const char *str, size_t length)
ZEND_API zend_result object_init_ex(zval *arg, zend_class_entry *class_type)
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type)
ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num)
ZEND_API zend_result zend_parse_method_parameters(uint32_t num_args, zval *this_ptr, const char *type_spec,...)
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format,...)
#define ZEND_PARSE_PARAMETERS_END()
#define ZEND_PARSE_PARAMETERS_NONE()
#define Z_PARAM_STRING(dest, dest_len)
#define ZEND_PARSE_PARAMETERS_END_EX(failure)
#define Z_PARAM_STRING_OR_NULL(dest, dest_len)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define Z_PARAM_OBJ_OF_CLASS(dest, _ce)
#define Z_PARAM_STR_OR_LONG(dest_str, dest_long)
#define Z_PARAM_BOOL(dest)
ZEND_API ZEND_COLD zend_object * zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code)
ZEND_API zend_class_entry * zend_ce_countable
ZEND_API zend_class_entry * zend_ce_aggregate
ZEND_API zend_result zend_create_internal_iterator_zval(zval *return_value, zval *obj)
struct _zend_string zend_string
ZEND_API const zend_object_handlers std_object_handlers
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
#define XtOffsetOf(s_type, field)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
ZEND_RESULT_CODE zend_result
struct _zend_object_handlers zend_object_handlers
ZEND_API void zval_ptr_dtor(zval *zval_ptr)