Lines Matching refs:tzobj

358 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv);
2051 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv) in php_timezone_to_string() argument
2053 switch (tzobj->type) { in php_timezone_to_string()
2055 ZVAL_STRING(zv, tzobj->tzi.tz->name); in php_timezone_to_string()
2058 timelib_sll utc_offset = tzobj->tzi.utc_offset; in php_timezone_to_string()
2082 ZVAL_STRING(zv, tzobj->tzi.z.abbr); in php_timezone_to_string()
2087 static void date_timezone_object_to_hash(php_timezone_obj *tzobj, HashTable *props) in date_timezone_object_to_hash() argument
2091 ZVAL_LONG(&zv, tzobj->type); in date_timezone_object_to_hash()
2094 php_timezone_to_string(tzobj, &zv); in date_timezone_object_to_hash()
2101 php_timezone_obj *tzobj; in date_object_get_properties_for_timezone() local
2114 tzobj = php_timezone_obj_from_obj(object); in date_object_get_properties_for_timezone()
2116 if (!tzobj->initialized) { in date_object_get_properties_for_timezone()
2120 date_timezone_object_to_hash(tzobj, props); in date_object_get_properties_for_timezone()
2129 php_timezone_obj *tzobj; in date_object_get_debug_info_timezone() local
2131 tzobj = php_timezone_obj_from_obj(object); in date_object_get_debug_info_timezone()
2137 ZVAL_LONG(&zv, tzobj->type); in date_object_get_debug_info_timezone()
2140 php_timezone_to_string(tzobj, &zv); in date_object_get_debug_info_timezone()
2434 php_timezone_obj *tzobj; in php_date_initialize() local
2436 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_initialize()
2437 switch (tzobj->type) { in php_date_initialize()
2439 tzi = tzobj->tzi.tz; in php_date_initialize()
2442 new_offset = tzobj->tzi.utc_offset; in php_date_initialize()
2445 new_offset = tzobj->tzi.z.utc_offset; in php_date_initialize()
2446 new_dst = tzobj->tzi.z.dst; in php_date_initialize()
2447 new_abbr = timelib_strdup(tzobj->tzi.z.abbr); in php_date_initialize()
2450 type = tzobj->type; in php_date_initialize()
2743 php_timezone_obj *tzobj; in php_date_initialize_from_hash() local
2751 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj)); in php_date_initialize_from_hash()
2752 tzobj->type = TIMELIB_ZONETYPE_ID; in php_date_initialize_from_hash()
2753 tzobj->tzi.tz = tzi; in php_date_initialize_from_hash()
2754 tzobj->initialized = 1; in php_date_initialize_from_hash()
3401 static void set_timezone_from_timelib_time(php_timezone_obj *tzobj, timelib_time *t) in set_timezone_from_timelib_time() argument
3404 if (tzobj->initialized && tzobj->type == TIMELIB_ZONETYPE_ABBR) { in set_timezone_from_timelib_time()
3405 timelib_free(tzobj->tzi.z.abbr); in set_timezone_from_timelib_time()
3409 tzobj->initialized = 1; in set_timezone_from_timelib_time()
3410 tzobj->type = t->zone_type; in set_timezone_from_timelib_time()
3414 tzobj->tzi.tz = t->tz_info; in set_timezone_from_timelib_time()
3417 tzobj->tzi.utc_offset = t->z; in set_timezone_from_timelib_time()
3420 tzobj->tzi.z.utc_offset = t->z; in set_timezone_from_timelib_time()
3421 tzobj->tzi.z.dst = t->dst; in set_timezone_from_timelib_time()
3422 tzobj->tzi.z.abbr = timelib_strdup(t->tz_abbr); in set_timezone_from_timelib_time()
3440 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3442 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_FUNCTION()
3443 set_timezone_from_timelib_time(tzobj, dateobj->time); in PHP_FUNCTION()
3453 php_timezone_obj *tzobj; in php_date_timezone_set() local
3457 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_timezone_set()
3459 switch (tzobj->type) { in php_date_timezone_set()
3461 timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset); in php_date_timezone_set()
3464 timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z); in php_date_timezone_set()
3467 timelib_set_timezone(dateobj->time, tzobj->tzi.tz); in php_date_timezone_set()
3785 static bool timezone_initialize(php_timezone_obj *tzobj, const char *tz, size_t tz_len, char **warn… in timezone_initialize() argument
3824 set_timezone_from_timelib_time(tzobj, dummy_t); in timezone_initialize()
3835 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3842 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value)); in PHP_FUNCTION()
3843 if (!timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz), &warning_message)) { in PHP_FUNCTION()
3856 php_timezone_obj *tzobj; in PHP_METHOD() local
3863 tzobj = Z_PHPTIMEZONE_P(ZEND_THIS); in PHP_METHOD()
3864 if (!timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz), &exception_message)) { in PHP_METHOD()
3871 static bool php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, H… in php_date_timezone_initialize_from_hash() argument
3894 return timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone), Z_STRLEN_P(z_timezone), NULL); in php_date_timezone_initialize_from_hash()
3900 php_timezone_obj *tzobj; in PHP_METHOD() local
3911 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_METHOD()
3912 if (!php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht)) { in PHP_METHOD()
3922 php_timezone_obj *tzobj; in PHP_METHOD() local
3927 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
3931 if (!php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht)) { in PHP_METHOD()
3941 php_timezone_obj *tzobj; in PHP_METHOD() local
3946 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
3947 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_METHOD()
3951 date_timezone_object_to_hash(tzobj, myht); in PHP_METHOD()
3953 add_common_properties(myht, &tzobj->std); in PHP_METHOD()
3985 php_timezone_obj *tzobj; in PHP_METHOD() local
3993 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
3996 if (!php_date_timezone_initialize_from_hash(&object, &tzobj, myht)) { in PHP_METHOD()
4008 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4013 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4014 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4015 php_timezone_to_string(tzobj, return_value); in PHP_FUNCTION()
4048 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4055 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4056 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4060 switch (tzobj->type) { in PHP_FUNCTION()
4062 offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz); in PHP_FUNCTION()
4067 RETURN_LONG(tzobj->tzi.utc_offset); in PHP_FUNCTION()
4070 RETURN_LONG(tzobj->tzi.z.utc_offset + (tzobj->tzi.z.dst * 3600)); in PHP_FUNCTION()
4080 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4088 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4089 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4090 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
4098 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[0].offset); \ in PHP_FUNCTION()
4099 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[0].isdst); \ in PHP_FUNCTION()
4100 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx])… in PHP_FUNCTION()
4107 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \ in PHP_FUNCTION()
4108 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \ in PHP_FUNCTION()
4109 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz… in PHP_FUNCTION()
4116 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[i].offset); \ in PHP_FUNCTION()
4117 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[i].isdst); \ in PHP_FUNCTION()
4118 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[i].abbr_idx])… in PHP_FUNCTION()
4130 #define add_last() add(tzobj->tzi.tz->bit64.timecnt - 1, timestamp_begin) in PHP_FUNCTION()
4141 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
4143 if (tzobj->tzi.tz->trans[begin] > timestamp_begin) { in PHP_FUNCTION()
4153 } while (begin < tzobj->tzi.tz->bit64.timecnt); in PHP_FUNCTION()
4158 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
4159 if (tzobj->tzi.tz->posix_info && tzobj->tzi.tz->posix_info->dst_end) { in PHP_FUNCTION()
4160 timelib_time_offset *tto = timelib_get_time_zone_info(timestamp_begin, tzobj->tzi.tz); in PHP_FUNCTION()
4171 for (i = begin; i < tzobj->tzi.tz->bit64.timecnt; ++i) { in PHP_FUNCTION()
4172 if (tzobj->tzi.tz->trans[i] < timestamp_end) { in PHP_FUNCTION()
4173 add(i, tzobj->tzi.tz->trans[i]); in PHP_FUNCTION()
4179 if (tzobj->tzi.tz->posix_info && tzobj->tzi.tz->posix_info->dst_end) { in PHP_FUNCTION()
4182 timelib_sll last_transition_ts = tzobj->tzi.tz->trans[tzobj->tzi.tz->bit64.timecnt - 1]; in PHP_FUNCTION()
4193 timelib_get_transitions_for_year(tzobj->tzi.tz, i, &transitions); in PHP_FUNCTION()
4216 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4221 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4222 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4223 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
4228 add_assoc_string(return_value, "country_code", tzobj->tzi.tz->location.country_code); in PHP_FUNCTION()
4229 add_assoc_double(return_value, "latitude", tzobj->tzi.tz->location.latitude); in PHP_FUNCTION()
4230 add_assoc_double(return_value, "longitude", tzobj->tzi.tz->location.longitude); in PHP_FUNCTION()
4231 add_assoc_string(return_value, "comments", tzobj->tzi.tz->location.comments); in PHP_FUNCTION()