Lines Matching refs:tzobj

179 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv);
1964 static void php_timezone_to_string(php_timezone_obj *tzobj, zval *zv) in php_timezone_to_string() argument
1966 switch (tzobj->type) { in php_timezone_to_string()
1968 ZVAL_STRING(zv, tzobj->tzi.tz->name); in php_timezone_to_string()
1972 timelib_sll utc_offset = tzobj->tzi.utc_offset; in php_timezone_to_string()
1983 ZVAL_STRING(zv, tzobj->tzi.z.abbr); in php_timezone_to_string()
1992 php_timezone_obj *tzobj; in date_object_get_properties_for_timezone() local
2005 tzobj = php_timezone_obj_from_obj(object); in date_object_get_properties_for_timezone()
2007 if (!tzobj->initialized) { in date_object_get_properties_for_timezone()
2011 ZVAL_LONG(&zv, tzobj->type); in date_object_get_properties_for_timezone()
2014 php_timezone_to_string(tzobj, &zv); in date_object_get_properties_for_timezone()
2024 php_timezone_obj *tzobj; in date_object_get_debug_info_timezone() local
2026 tzobj = php_timezone_obj_from_obj(object); in date_object_get_debug_info_timezone()
2032 ZVAL_LONG(&zv, tzobj->type); in date_object_get_debug_info_timezone()
2035 php_timezone_to_string(tzobj, &zv); in date_object_get_debug_info_timezone()
2284 php_timezone_obj *tzobj; in php_date_initialize() local
2286 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_initialize()
2287 switch (tzobj->type) { in php_date_initialize()
2289 tzi = tzobj->tzi.tz; in php_date_initialize()
2292 new_offset = tzobj->tzi.utc_offset; in php_date_initialize()
2295 new_offset = tzobj->tzi.z.utc_offset; in php_date_initialize()
2296 new_dst = tzobj->tzi.z.dst; in php_date_initialize()
2297 new_abbr = timelib_strdup(tzobj->tzi.z.abbr); in php_date_initialize()
2300 type = tzobj->type; in php_date_initialize()
2580 php_timezone_obj *tzobj; in php_date_initialize_from_hash() local
2588 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, &tmp_obj)); in php_date_initialize_from_hash()
2589 tzobj->type = TIMELIB_ZONETYPE_ID; in php_date_initialize_from_hash()
2590 tzobj->tzi.tz = tzi; in php_date_initialize_from_hash()
2591 tzobj->initialized = 1; in php_date_initialize_from_hash()
3053 static void set_timezone_from_timelib_time(php_timezone_obj *tzobj, timelib_time *t) in set_timezone_from_timelib_time() argument
3055 tzobj->initialized = 1; in set_timezone_from_timelib_time()
3056 tzobj->type = t->zone_type; in set_timezone_from_timelib_time()
3059 tzobj->tzi.tz = t->tz_info; in set_timezone_from_timelib_time()
3062 tzobj->tzi.utc_offset = t->z; in set_timezone_from_timelib_time()
3065 tzobj->tzi.z.utc_offset = t->z; in set_timezone_from_timelib_time()
3066 tzobj->tzi.z.dst = t->dst; in set_timezone_from_timelib_time()
3067 tzobj->tzi.z.abbr = timelib_strdup(t->tz_abbr); in set_timezone_from_timelib_time()
3085 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3087 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_FUNCTION()
3088 set_timezone_from_timelib_time(tzobj, dateobj->time); in PHP_FUNCTION()
3098 php_timezone_obj *tzobj; in php_date_timezone_set() local
3102 tzobj = Z_PHPTIMEZONE_P(timezone_object); in php_date_timezone_set()
3104 switch (tzobj->type) { in php_date_timezone_set()
3106 timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset); in php_date_timezone_set()
3109 timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z); in php_date_timezone_set()
3112 timelib_set_timezone(dateobj->time, tzobj->tzi.tz); in php_date_timezone_set()
3428 static int timezone_initialize(php_timezone_obj *tzobj, const char *tz, size_t tz_len) /* {{{ */ in timezone_initialize() argument
3459 set_timezone_from_timelib_time(tzobj, dummy_t); in timezone_initialize()
3470 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3476 tzobj = Z_PHPTIMEZONE_P(php_date_instantiate(date_ce_timezone, return_value)); in PHP_FUNCTION()
3477 if (SUCCESS != timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz))) { in PHP_FUNCTION()
3488 php_timezone_obj *tzobj; in PHP_METHOD() local
3496 tzobj = Z_PHPTIMEZONE_P(ZEND_THIS); in PHP_METHOD()
3497 timezone_initialize(tzobj, ZSTR_VAL(tz), ZSTR_LEN(tz)); in PHP_METHOD()
3502 static int php_date_timezone_initialize_from_hash(zval **return_value, php_timezone_obj **tzobj, Ha… in php_date_timezone_initialize_from_hash() argument
3516 if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_P(z_timezone), Z_STRLEN_P(z_timezone))) { in php_date_timezone_initialize_from_hash()
3527 php_timezone_obj *tzobj; in PHP_METHOD() local
3538 tzobj = Z_PHPTIMEZONE_P(return_value); in PHP_METHOD()
3539 if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht) != SUCCESS) { in PHP_METHOD()
3550 php_timezone_obj *tzobj; in PHP_METHOD() local
3555 tzobj = Z_PHPTIMEZONE_P(object); in PHP_METHOD()
3559 if(php_date_timezone_initialize_from_hash(&return_value, &tzobj, myht) != SUCCESS) { in PHP_METHOD()
3569 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3574 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
3575 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
3576 php_timezone_to_string(tzobj, return_value); in PHP_FUNCTION()
3609 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3616 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
3617 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
3621 switch (tzobj->type) { in PHP_FUNCTION()
3623 offset = timelib_get_time_zone_info(dateobj->time->sse, tzobj->tzi.tz); in PHP_FUNCTION()
3628 RETURN_LONG(tzobj->tzi.utc_offset); in PHP_FUNCTION()
3631 RETURN_LONG(tzobj->tzi.z.utc_offset + (tzobj->tzi.z.dst * 3600)); in PHP_FUNCTION()
3641 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3648 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
3649 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
3650 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
3658 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[0].offset); \ in PHP_FUNCTION()
3659 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[0].isdst); \ in PHP_FUNCTION()
3660 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[0].abbr_idx])… in PHP_FUNCTION()
3667 add_assoc_long(&element, "offset", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].offset); \ in PHP_FUNCTION()
3668 add_assoc_bool(&element, "isdst", tzobj->tzi.tz->type[tzobj->tzi.tz->trans_idx[i]].isdst); \ in PHP_FUNCTION()
3669 …add_assoc_string(&element, "abbr", &tzobj->tzi.tz->timezone_abbr[tzobj->tzi.tz->type[tzobj->tzi.tz… in PHP_FUNCTION()
3672 #define add_last() add(tzobj->tzi.tz->bit64.timecnt - 1, timestamp_begin) in PHP_FUNCTION()
3683 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
3685 if (tzobj->tzi.tz->trans[begin] > timestamp_begin) { in PHP_FUNCTION()
3695 } while (begin < tzobj->tzi.tz->bit64.timecnt); in PHP_FUNCTION()
3700 if (tzobj->tzi.tz->bit64.timecnt > 0) { in PHP_FUNCTION()
3707 for (i = begin; i < tzobj->tzi.tz->bit64.timecnt; ++i) { in PHP_FUNCTION()
3708 if (tzobj->tzi.tz->trans[i] < timestamp_end) { in PHP_FUNCTION()
3709 add(i, tzobj->tzi.tz->trans[i]); in PHP_FUNCTION()
3720 php_timezone_obj *tzobj; in PHP_FUNCTION() local
3725 tzobj = Z_PHPTIMEZONE_P(object); in PHP_FUNCTION()
3726 DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone); in PHP_FUNCTION()
3727 if (tzobj->type != TIMELIB_ZONETYPE_ID) { in PHP_FUNCTION()
3732 add_assoc_string(return_value, "country_code", tzobj->tzi.tz->location.country_code); in PHP_FUNCTION()
3733 add_assoc_double(return_value, "latitude", tzobj->tzi.tz->location.latitude); in PHP_FUNCTION()
3734 add_assoc_double(return_value, "longitude", tzobj->tzi.tz->location.longitude); in PHP_FUNCTION()
3735 add_assoc_string(return_value, "comments", tzobj->tzi.tz->location.comments); in PHP_FUNCTION()