Lines Matching refs:tzobj

358 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv);
2060 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv) in php_timezone_to_string() argument
2062 switch (tzobj->type) { in php_timezone_to_string()
2064 ZVAL_STRING(zv, tzobj->tzi.tz->name); in php_timezone_to_string()
2067 timelib_sll utc_offset = tzobj->tzi.utc_offset; in php_timezone_to_string()
2091 ZVAL_STRING(zv, tzobj->tzi.z.abbr); in php_timezone_to_string()
2096 static void date_timezone_object_to_hash(php_timezone_obj *tzobj, HashTable *props) in date_timezone_object_to_hash() argument
2100 ZVAL_LONG(&zv, tzobj->type); in date_timezone_object_to_hash()
2103 php_timezone_to_string(tzobj, &zv); in date_timezone_object_to_hash()
2110 php_timezone_obj *tzobj; in date_object_get_properties_for_timezone() local
2123 tzobj = php_timezone_obj_from_obj(object); in date_object_get_properties_for_timezone()
2125 if (!tzobj->initialized) { in date_object_get_properties_for_timezone()
2129 date_timezone_object_to_hash(tzobj, props); in date_object_get_properties_for_timezone()
2138 php_timezone_obj *tzobj; in date_object_get_debug_info_timezone() local
2140 tzobj = php_timezone_obj_from_obj(object); in date_object_get_debug_info_timezone()
2146 ZVAL_LONG(&zv, tzobj->type); in date_object_get_debug_info_timezone()
2149 php_timezone_to_string(tzobj, &zv); in date_object_get_debug_info_timezone()
2443 php_timezone_obj *tzobj; in php_date_initialize() local
2445 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_initialize()
2446 switch (tzobj->type) { in php_date_initialize()
2448 tzi = tzobj->tzi.tz; in php_date_initialize()
2451 new_offset = tzobj->tzi.utc_offset; in php_date_initialize()
2454 new_offset = tzobj->tzi.z.utc_offset; in php_date_initialize()
2455 new_dst = tzobj->tzi.z.dst; in php_date_initialize()
2456 new_abbr = timelib_strdup(tzobj->tzi.z.abbr); in php_date_initialize()
2459 type = tzobj->type; in php_date_initialize()
2871 php_timezone_obj *tzobj; in php_date_initialize_from_hash() local
2879 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj)); in php_date_initialize_from_hash()
2880 tzobj->type = TIMELIB_ZONETYPE_ID; in php_date_initialize_from_hash()
2881 tzobj->tzi.tz = tzi; in php_date_initialize_from_hash()
2882 tzobj->initialized = 1; in php_date_initialize_from_hash()
3529 static void set_timezone_from_timelib_time(php_timezone_obj *tzobj, timelib_time *t) in set_timezone_from_timelib_time() argument
3532 if (tzobj->initialized && tzobj->type == TIMELIB_ZONETYPE_ABBR) { in set_timezone_from_timelib_time()
3533 timelib_free(tzobj->tzi.z.abbr); in set_timezone_from_timelib_time()
3537 tzobj->initialized = 1; in set_timezone_from_timelib_time()
3538 tzobj->type = t->zone_type; in set_timezone_from_timelib_time()
3542 tzobj->tzi.tz = t->tz_info; in set_timezone_from_timelib_time()
3545 tzobj->tzi.utc_offset = t->z; in set_timezone_from_timelib_time()
3548 tzobj->tzi.z.utc_offset = t->z; in set_timezone_from_timelib_time()
3549 tzobj->tzi.z.dst = t->dst; in set_timezone_from_timelib_time()
3550 tzobj->tzi.z.abbr = timelib_strdup(t->tz_abbr); in set_timezone_from_timelib_time()
3568 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3570 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_FUNCTION()
3571 set_timezone_from_timelib_time(tzobj, dateobj->time); in PHP_FUNCTION()
3581 php_timezone_obj *tzobj; in php_date_timezone_set() local
3585 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_timezone_set()
3587 switch (tzobj->type) { in php_date_timezone_set()
3589 timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset); in php_date_timezone_set()
3592 timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z); in php_date_timezone_set()
3595 timelib_set_timezone(dateobj->time, tzobj->tzi.tz); in php_date_timezone_set()
3992 static bool timezone_initialize(php_timezone_obj *tzobj, const char *tz, size_t tz_len, char **warn… in timezone_initialize() argument
4031 set_timezone_from_timelib_time(tzobj, dummy_t); in timezone_initialize()
4042 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4049 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value)); in PHP_FUNCTION()
4050 if (!timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz), &warning_message)) { in PHP_FUNCTION()
4063 php_timezone_obj *tzobj; in PHP_METHOD() local
4070 tzobj = Z_PHPTIMEZONE_P(ZEND_THIS); in PHP_METHOD()
4071 if (!timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz), &exception_message)) { in PHP_METHOD()
4078 static bool php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, H… in php_date_timezone_initialize_from_hash() argument
4101 return timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone), Z_STRLEN_P(z_timezone), NULL); in php_date_timezone_initialize_from_hash()
4107 php_timezone_obj *tzobj; in PHP_METHOD() local
4118 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_METHOD()
4119 if (!php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht)) { in PHP_METHOD()
4129 php_timezone_obj *tzobj; in PHP_METHOD() local
4134 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
4138 if (!php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht)) { in PHP_METHOD()
4148 php_timezone_obj *tzobj; in PHP_METHOD() local
4153 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
4154 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_METHOD()
4158 date_timezone_object_to_hash(tzobj, myht); in PHP_METHOD()
4160 add_common_properties(myht, &tzobj->std); in PHP_METHOD()
4192 php_timezone_obj *tzobj; in PHP_METHOD() local
4200 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
4203 if (!php_date_timezone_initialize_from_hash(&object, &tzobj, myht)) { in PHP_METHOD()
4215 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4220 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4221 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4222 php_timezone_to_string(tzobj, return_value); in PHP_FUNCTION()
4255 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4262 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4263 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4267 switch (tzobj->type) { in PHP_FUNCTION()
4269 offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz); in PHP_FUNCTION()
4274 RETURN_LONG(tzobj->tzi.utc_offset); in PHP_FUNCTION()
4277 RETURN_LONG(tzobj->tzi.z.utc_offset + (tzobj->tzi.z.dst * 3600)); in PHP_FUNCTION()
4287 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4295 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4296 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4297 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
4305 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[0].offset); \ in PHP_FUNCTION()
4306 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[0].isdst); \ in PHP_FUNCTION()
4307 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx])… in PHP_FUNCTION()
4314 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \ in PHP_FUNCTION()
4315 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \ in PHP_FUNCTION()
4316 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz… in PHP_FUNCTION()
4323 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[i].offset); \ in PHP_FUNCTION()
4324 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[i].isdst); \ in PHP_FUNCTION()
4325 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[i].abbr_idx])… in PHP_FUNCTION()
4337 #define add_last() add(tzobj->tzi.tz->bit64.timecnt - 1, timestamp_begin) in PHP_FUNCTION()
4348 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
4350 if (tzobj->tzi.tz->trans[begin] > timestamp_begin) { in PHP_FUNCTION()
4360 } while (begin < tzobj->tzi.tz->bit64.timecnt); in PHP_FUNCTION()
4365 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
4366 if (tzobj->tzi.tz->posix_info && tzobj->tzi.tz->posix_info->dst_end) { in PHP_FUNCTION()
4367 timelib_time_offset *tto = timelib_get_time_zone_info(timestamp_begin, tzobj->tzi.tz); in PHP_FUNCTION()
4378 for (i = begin; i < tzobj->tzi.tz->bit64.timecnt; ++i) { in PHP_FUNCTION()
4379 if (tzobj->tzi.tz->trans[i] < timestamp_end) { in PHP_FUNCTION()
4380 add(i, tzobj->tzi.tz->trans[i]); in PHP_FUNCTION()
4386 if (tzobj->tzi.tz->posix_info && tzobj->tzi.tz->posix_info->dst_end) { in PHP_FUNCTION()
4389 timelib_sll last_transition_ts = tzobj->tzi.tz->trans[tzobj->tzi.tz->bit64.timecnt - 1]; in PHP_FUNCTION()
4400 timelib_get_transitions_for_year(tzobj->tzi.tz, i, &transitions); in PHP_FUNCTION()
4423 php_timezone_obj *tzobj; in PHP_FUNCTION() local
4428 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
4429 DATE_CHECK_INITIALIZED(tzobj->initialized, Z_OBJCE_P(object)); in PHP_FUNCTION()
4430 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
4435 add_assoc_string(return_value, "country_code", tzobj->tzi.tz->location.country_code); in PHP_FUNCTION()
4436 add_assoc_double(return_value, "latitude", tzobj->tzi.tz->location.latitude); in PHP_FUNCTION()
4437 add_assoc_double(return_value, "longitude", tzobj->tzi.tz->location.longitude); in PHP_FUNCTION()
4438 add_assoc_string(return_value, "comments", tzobj->tzi.tz->location.comments); in PHP_FUNCTION()