Lines Matching refs:tzobj

340 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv);
2023 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv) in php_timezone_to_string() argument
2025 switch (tzobj->type) { in php_timezone_to_string()
2027 ZVAL_STRING(zv, tzobj->tzi.tz->name); in php_timezone_to_string()
2030 timelib_sll utc_offset = tzobj->tzi.utc_offset; in php_timezone_to_string()
2054 ZVAL_STRING(zv, tzobj->tzi.z.abbr); in php_timezone_to_string()
2059 void date_timezone_object_to_hash(php_timezone_obj *tzobj, HashTable *props) in date_timezone_object_to_hash() argument
2063 ZVAL_LONG(&zv, tzobj->type); in date_timezone_object_to_hash()
2066 php_timezone_to_string(tzobj, &zv); in date_timezone_object_to_hash()
2073 php_timezone_obj *tzobj; in date_object_get_properties_for_timezone() local
2086 tzobj = php_timezone_obj_from_obj(object); in date_object_get_properties_for_timezone()
2088 if (!tzobj->initialized) { in date_object_get_properties_for_timezone()
2092 date_timezone_object_to_hash(tzobj, props); in date_object_get_properties_for_timezone()
2101 php_timezone_obj *tzobj; in date_object_get_debug_info_timezone() local
2103 tzobj = php_timezone_obj_from_obj(object); in date_object_get_debug_info_timezone()
2109 ZVAL_LONG(&zv, tzobj->type); in date_object_get_debug_info_timezone()
2112 php_timezone_to_string(tzobj, &zv); in date_object_get_debug_info_timezone()
2409 php_timezone_obj *tzobj; in php_date_initialize() local
2411 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_initialize()
2412 switch (tzobj->type) { in php_date_initialize()
2414 tzi = tzobj->tzi.tz; in php_date_initialize()
2417 new_offset = tzobj->tzi.utc_offset; in php_date_initialize()
2420 new_offset = tzobj->tzi.z.utc_offset; in php_date_initialize()
2421 new_dst = tzobj->tzi.z.dst; in php_date_initialize()
2422 new_abbr = timelib_strdup(tzobj->tzi.z.abbr); in php_date_initialize()
2428 type = tzobj->type; in php_date_initialize()
2721 php_timezone_obj *tzobj; in php_date_initialize_from_hash() local
2729 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj)); in php_date_initialize_from_hash()
2730 tzobj->type = TIMELIB_ZONETYPE_ID; in php_date_initialize_from_hash()
2731 tzobj->tzi.tz = tzi; in php_date_initialize_from_hash()
2732 tzobj->initialized = 1; in php_date_initialize_from_hash()
3327 static void set_timezone_from_timelib_time(php_timezone_obj *tzobj, timelib_time *t) in set_timezone_from_timelib_time() argument
3330 if (tzobj->initialized && tzobj->type == TIMELIB_ZONETYPE_ABBR) { in set_timezone_from_timelib_time()
3331 timelib_free(tzobj->tzi.z.abbr); in set_timezone_from_timelib_time()
3335 tzobj->initialized = 1; in set_timezone_from_timelib_time()
3336 tzobj->type = t->zone_type; in set_timezone_from_timelib_time()
3340 tzobj->tzi.tz = t->tz_info; in set_timezone_from_timelib_time()
3343 tzobj->tzi.utc_offset = t->z; in set_timezone_from_timelib_time()
3346 tzobj->tzi.z.utc_offset = t->z; in set_timezone_from_timelib_time()
3347 tzobj->tzi.z.dst = t->dst; in set_timezone_from_timelib_time()
3348 tzobj->tzi.z.abbr = timelib_strdup(t->tz_abbr); in set_timezone_from_timelib_time()
3366 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3368 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_FUNCTION()
3369 set_timezone_from_timelib_time(tzobj, dateobj->time); in PHP_FUNCTION()
3379 php_timezone_obj *tzobj; in php_date_timezone_set() local
3383 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_timezone_set()
3385 switch (tzobj->type) { in php_date_timezone_set()
3387 timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset); in php_date_timezone_set()
3390 timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z); in php_date_timezone_set()
3393 timelib_set_timezone(dateobj->time, tzobj->tzi.tz); in php_date_timezone_set()
3711 static bool timezone_initialize(php_timezone_obj *tzobj, const char *tz, size_t tz_len) /* {{{ */ in timezone_initialize() argument
3742 set_timezone_from_timelib_time(tzobj, dummy_t); in timezone_initialize()
3753 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3759 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value)); in PHP_FUNCTION()
3760 if (!timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz))) { in PHP_FUNCTION()
3771 php_timezone_obj *tzobj; in PHP_METHOD() local
3779 tzobj = Z_PHPTIMEZONE_P(ZEND_THIS); in PHP_METHOD()
3780 timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz)); in PHP_METHOD()
3785 static bool php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, H… in php_date_timezone_initialize_from_hash() argument
3805 return timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone), Z_STRLEN_P(z_timezone)); in php_date_timezone_initialize_from_hash()
3811 php_timezone_obj *tzobj; in PHP_METHOD() local
3822 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_METHOD()
3823 if (!php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht)) { in PHP_METHOD()
3834 php_timezone_obj *tzobj; in PHP_METHOD() local
3839 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
3843 if (!php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht)) { in PHP_METHOD()
3854 php_timezone_obj *tzobj; in PHP_METHOD() local
3859 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
3860 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_METHOD()
3864 date_timezone_object_to_hash(tzobj, myht); in PHP_METHOD()
3866 add_common_properties(myht, &tzobj->std); in PHP_METHOD()
3898 php_timezone_obj *tzobj; in PHP_METHOD() local
3906 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
3909 if (!php_date_timezone_initialize_from_hash(&object, &tzobj, myht)) { in PHP_METHOD()
3922 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3927 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
3928 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
3929 php_timezone_to_string(tzobj, return_value); in PHP_FUNCTION()
3962 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3969 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
3970 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
3974 switch (tzobj->type) { in PHP_FUNCTION()
3976 offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz); in PHP_FUNCTION()
3981 RETURN_LONG(tzobj->tzi.utc_offset); in PHP_FUNCTION()
3984 RETURN_LONG(tzobj->tzi.z.utc_offset + (tzobj->tzi.z.dst * 3600)); in PHP_FUNCTION()
3994 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4002 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4003 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
4004 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
4012 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[0].offset); \ in PHP_FUNCTION()
4013 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[0].isdst); \ in PHP_FUNCTION()
4014 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx])… in PHP_FUNCTION()
4021 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \ in PHP_FUNCTION()
4022 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \ in PHP_FUNCTION()
4023 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz… in PHP_FUNCTION()
4030 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[i].offset); \ in PHP_FUNCTION()
4031 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[i].isdst); \ in PHP_FUNCTION()
4032 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[i].abbr_idx])… in PHP_FUNCTION()
4044 #define add_last() add(tzobj->tzi.tz->bit64.timecnt - 1, timestamp_begin) in PHP_FUNCTION()
4055 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
4057 if (tzobj->tzi.tz->trans[begin] > timestamp_begin) { in PHP_FUNCTION()
4067 } while (begin < tzobj->tzi.tz->bit64.timecnt); in PHP_FUNCTION()
4072 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
4073 if (tzobj->tzi.tz->posix_info && tzobj->tzi.tz->posix_info->dst_end) { in PHP_FUNCTION()
4074 timelib_time_offset *tto = timelib_get_time_zone_info(timestamp_begin, tzobj->tzi.tz); in PHP_FUNCTION()
4085 for (i = begin; i < tzobj->tzi.tz->bit64.timecnt; ++i) { in PHP_FUNCTION()
4086 if (tzobj->tzi.tz->trans[i] < timestamp_end) { in PHP_FUNCTION()
4087 add(i, tzobj->tzi.tz->trans[i]); in PHP_FUNCTION()
4093 if (tzobj->tzi.tz->posix_info && tzobj->tzi.tz->posix_info->dst_end) { in PHP_FUNCTION()
4096 timelib_sll last_transition_ts = tzobj->tzi.tz->trans[tzobj->tzi.tz->bit64.timecnt - 1]; in PHP_FUNCTION()
4107 timelib_get_transitions_for_year(tzobj->tzi.tz, i, &transitions); in PHP_FUNCTION()
4130 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4135 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4136 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
4137 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
4142 add_assoc_string(return_value, "country_code", tzobj->tzi.tz->location.country_code); in PHP_FUNCTION()
4143 add_assoc_double(return_value, "latitude", tzobj->tzi.tz->location.latitude); in PHP_FUNCTION()
4144 add_assoc_double(return_value, "longitude", tzobj->tzi.tz->location.longitude); in PHP_FUNCTION()
4145 add_assoc_string(return_value, "comments", tzobj->tzi.tz->location.comments); in PHP_FUNCTION()