derick Wed Jan 4 12:57:04 2006 UTC
Removed files:
/php-src/ext/standard php_sunfuncs.h sunfuncs.c
Modified files:
/php-src/ext/date php_date.c php_date.h
/php-src/ext/date/lib astro.c parse_date.c parse_date.re parse_tz.c
timelib.h unixtime2tm.c
/php-src/ext/standard basic_functions.c config.m4 config.w32
php_standard.h
/php-src/ext/standard/tests/general_functions sunfuncts.phpt
Log:
- New implementation of the sunset algorithm. Fixes bugs #33789, #33671,
#32820
and #30937.
#- Didn't add it to news yet, as we'll merge this to PHP 5.1.x (just need to
# wait for Ilia to approve it for 5.1.2).
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/php_date.c?r1=1.81&r2=1.82&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.81 php-src/ext/date/php_date.c:1.82
--- php-src/ext/date/php_date.c:1.81 Sun Jan 1 13:09:48 2006
+++ php-src/ext/date/php_date.c Wed Jan 4 12:57:03 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.c,v 1.81 2006/01/01 13:09:48 sniper Exp $ */
+/* $Id: php_date.c,v 1.82 2006/01/04 12:57:03 derick Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -74,6 +74,11 @@
/* Options and Configuration */
PHP_FE(date_default_timezone_set, NULL)
PHP_FE(date_default_timezone_get, NULL)
+
+ /* Astronomical functions */
+ PHP_FE(date_sunrise, NULL)
+ PHP_FE(date_sunset, NULL)
+ PHP_FE(date_sun_info, NULL)
{NULL, NULL, NULL}
};
@@ -113,9 +118,22 @@
timelib_tzdb *php_date_global_timezone_db;
int php_date_global_timezone_db_enabled;
+#define DATE_DEFAULT_LATITUDE "31.7667"
+#define DATE_DEFAULT_LONGITUDE "35.2333"
+
+/* on 90'35; common sunset declaration (start of sun body appear) */
+#define DATE_SUNSET_ZENITH "90.583333"
+
+/* on 90'35; common sunrise declaration (sun body disappeared) */
+#define DATE_SUNRISE_ZENITH "90.583333"
+
/* {{{ INI Settings */
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("date.timezone", "", PHP_INI_ALL, OnUpdateString,
default_timezone, zend_date_globals, date_globals)
+ PHP_INI_ENTRY("date.default_latitude", DATE_DEFAULT_LATITUDE,
PHP_INI_ALL, NULL)
+ PHP_INI_ENTRY("date.default_longitude",
DATE_DEFAULT_LONGITUDE, PHP_INI_ALL, NULL)
+ PHP_INI_ENTRY("date.sunset_zenith", DATE_SUNSET_ZENITH,
PHP_INI_ALL, NULL)
+ PHP_INI_ENTRY("date.sunrise_zenith", DATE_SUNRISE_ZENITH,
PHP_INI_ALL, NULL)
PHP_INI_END()
/* }}} */
@@ -235,6 +253,11 @@
"methods and you are still getting this warning, you most likely " \
"misspelled the timezone identifier. "
+#define SUNFUNCS_RET_TIMESTAMP 0
+#define SUNFUNCS_RET_STRING 1
+#define SUNFUNCS_RET_DOUBLE 2
+
+
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(date)
{
@@ -254,6 +277,10 @@
REGISTER_STRING_CONSTANT("DATE_RSS", DATE_FORMAT_RFC1123, CONST_CS
| CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_W3C", DATE_FORMAT_ISO8601, CONST_CS
| CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SUNFUNCS_RET_TIMESTAMP",
SUNFUNCS_RET_TIMESTAMP, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SUNFUNCS_RET_STRING", SUNFUNCS_RET_STRING,
CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SUNFUNCS_RET_DOUBLE", SUNFUNCS_RET_DOUBLE,
CONST_CS | CONST_PERSISTENT);
+
php_date_global_timezone_db = NULL;
php_date_global_timezone_db_enabled = 0;
@@ -1797,6 +1824,211 @@
}
/* }}} */
+/* {{{ php_do_date_sunrise_sunset
+ * Common for date_sunrise() and date_sunset() functions
+ */
+static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int
calc_sunset)
+{
+ double latitude, longitude, zenith, gmt_offset = 0, altitude;
+ double h_rise, h_set, N;
+ timelib_sll rise, set, transit;
+ long time, retformat;
+ int rs;
+ timelib_time *t;
+ timelib_tzinfo *tzi;
+ char retstr[6];
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|ldddd", &time,
&retformat, &latitude, &longitude, &zenith, &gmt_offset) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ switch (ZEND_NUM_ARGS()) {
+ case 1:
+ retformat = SUNFUNCS_RET_STRING;
+ case 2:
+ latitude = INI_FLT("date.default_latitude");
+ case 3:
+ longitude = INI_FLT("date.default_longitude");
+ case 4:
+ if (calc_sunset) {
+ zenith = INI_FLT("date.sunset_zenith");
+ } else {
+ zenith = INI_FLT("date.sunrise_zenith");
+ }
+ case 5:
+ case 6:
+ break;
+ default:
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid
format");
+ RETURN_FALSE;
+ break;
+ }
+ if (retformat != SUNFUNCS_RET_TIMESTAMP &&
+ retformat != SUNFUNCS_RET_STRING &&
+ retformat != SUNFUNCS_RET_DOUBLE)
+ {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong return
format given, pick one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING or
SUNFUNCS_RET_DOUBLE");
+ RETURN_FALSE;
+ }
+ altitude = 90 - zenith;
+
+ /* Initialize time struct */
+ t = timelib_time_ctor();
+ tzi = get_timezone_info(TSRMLS_C);
+ t->tz_info = tzi;
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+
+ if (ZEND_NUM_ARGS() <= 5) {
+ gmt_offset = timelib_get_current_offset(t) / 3600;
+ }
+
+ timelib_unixtime2local(t, time);
+ rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude,
altitude > -1 ? 1 : 0, &h_rise, &h_set, &rise, &set, &transit);
+
+ if (rs != 0) {
+ RETURN_FALSE;
+ }
+
+ if (retformat == SUNFUNCS_RET_TIMESTAMP) {
+ RETURN_LONG(calc_sunset ? set : rise);
+ }
+ N = (calc_sunset ? h_set : h_rise) + gmt_offset;
+ while (N > 24) {
+ N -= 24;
+ }
+ while (N < 0) {
+ N += 24;
+ }
+ switch (retformat) {
+ case SUNFUNCS_RET_STRING:
+ sprintf(retstr, "%02d:%02d", (int) N, (int) (60 * (N -
(int) N)));
+ RETURN_STRINGL(retstr, 5, 1);
+ break;
+ case SUNFUNCS_RET_DOUBLE:
+ RETURN_DOUBLE(N);
+ break;
+ }
+}
+/* }}} */
+
+/* {{{ proto mixed date_sunrise(mixed time [, int format [, float latitude [,
float longitude [, float zenith [, float gmt_offset]]]]])
+ Returns time of sunrise for a given day and location */
+PHP_FUNCTION(date_sunrise)
+{
+ php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto mixed date_sunset(mixed time [, int format [, float latitude [,
float longitude [, float zenith [, float gmt_offset]]]]])
+ Returns time of sunset for a given day and location */
+PHP_FUNCTION(date_sunset)
+{
+ php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+/* }}} */
+
+/* {{{ proto array date_sun_info(long time, float latitude, float longitude)
+ Returns an array with information about sun set/rise and twilight begin/end
*/
+PHP_FUNCTION(date_sun_info)
+{
+ long time;
+ double latitude, longitude;
+ timelib_time *t, *t2;
+ timelib_tzinfo *tzi;
+ int rs;
+ timelib_sll rise, set, transit;
+ int dummy;
+ double ddummy;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ldd", &time,
&latitude, &longitude) == FAILURE) {
+ RETURN_FALSE;
+ }
+ /* Initialize time struct */
+ t = timelib_time_ctor();
+ tzi = get_timezone_info(TSRMLS_C);
+ t->tz_info = tzi;
+ t->zone_type = TIMELIB_ZONETYPE_ID;
+ timelib_unixtime2local(t, time);
+
+ /* Setup */
+ t2 = timelib_time_ctor();
+ array_init(return_value);
+
+ /* Get sun up/down and transit */
+ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -35.0/60,
1, &ddummy, &ddummy, &rise, &set, &transit);
+ switch (rs) {
+ case -1: /* always below */
+ add_assoc_bool(return_value, "sunrise", 0);
+ add_assoc_bool(return_value, "sunset", 0);
+ break;
+ case 1: /* always above */
+ add_assoc_bool(return_value, "sunrise", 1);
+ add_assoc_bool(return_value, "sunset", 1);
+ break;
+ default:
+ t2->sse = rise;
+ add_assoc_long(return_value, "sunrise",
timelib_date_to_int(t2, &dummy));
+ t2->sse = set;
+ add_assoc_long(return_value, "sunset",
timelib_date_to_int(t2, &dummy));
+ }
+ t2->sse = transit;
+ add_assoc_long(return_value, "transit", timelib_date_to_int(t2,
&dummy));
+
+ /* Get civil twilight */
+ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -6.0, 0,
&ddummy, &ddummy, &rise, &set, &transit);
+ switch (rs) {
+ case -1: /* always below */
+ add_assoc_bool(return_value, "civil_twilight_begin", 0);
+ add_assoc_bool(return_value, "civil_twilight_end", 0);
+ break;
+ case 1: /* always above */
+ add_assoc_bool(return_value, "civil_twilight_begin", 1);
+ add_assoc_bool(return_value, "civil_twilight_end", 1);
+ break;
+ default:
+ t2->sse = rise;
+ add_assoc_long(return_value, "civil_twilight_begin",
timelib_date_to_int(t2, &dummy));
+ t2->sse = set;
+ add_assoc_long(return_value, "civil_twilight_end",
timelib_date_to_int(t2, &dummy));
+ }
+
+ /* Get nautical twilight */
+ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -12.0, 0,
&ddummy, &ddummy, &rise, &set, &transit);
+ switch (rs) {
+ case -1: /* always below */
+ add_assoc_bool(return_value, "nautical_twilight_begin",
0);
+ add_assoc_bool(return_value, "nautical_twilight_end",
0);
+ break;
+ case 1: /* always above */
+ add_assoc_bool(return_value, "nautical_twilight_begin",
1);
+ add_assoc_bool(return_value, "nautical_twilight_end",
1);
+ break;
+ default:
+ t2->sse = rise;
+ add_assoc_long(return_value, "nautical_twilight_begin",
timelib_date_to_int(t2, &dummy));
+ t2->sse = set;
+ add_assoc_long(return_value, "nautical_twilight_end",
timelib_date_to_int(t2, &dummy));
+ }
+
+ /* Get astronomical twilight */
+ rs = timelib_astro_rise_set_altitude(t, latitude, longitude, -18.0, 0,
&ddummy, &ddummy, &rise, &set, &transit);
+ switch (rs) {
+ case -1: /* always below */
+ add_assoc_bool(return_value,
"astronomical_twilight_begin", 0);
+ add_assoc_bool(return_value,
"astronomical_twilight_end", 0);
+ break;
+ case 1: /* always above */
+ add_assoc_bool(return_value,
"astronomical_twilight_begin", 1);
+ add_assoc_bool(return_value,
"astronomical_twilight_end", 1);
+ break;
+ default:
+ t2->sse = rise;
+ add_assoc_long(return_value,
"astronomical_twilight_begin", timelib_date_to_int(t2, &dummy));
+ t2->sse = set;
+ add_assoc_long(return_value,
"astronomical_twilight_end", timelib_date_to_int(t2, &dummy));
+ }
+}
+/* }}} */
/*
* Local variables:
* tab-width: 4
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/php_date.h?r1=1.26&r2=1.27&diff_format=u
Index: php-src/ext/date/php_date.h
diff -u php-src/ext/date/php_date.h:1.26 php-src/ext/date/php_date.h:1.27
--- php-src/ext/date/php_date.h:1.26 Sun Jan 1 13:09:48 2006
+++ php-src/ext/date/php_date.h Wed Jan 4 12:57:03 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.h,v 1.26 2006/01/01 13:09:48 sniper Exp $ */
+/* $Id: php_date.h,v 1.27 2006/01/04 12:57:03 derick Exp $ */
#ifndef PHP_DATE_H
#define PHP_DATE_H
@@ -72,6 +72,11 @@
PHP_FUNCTION(date_default_timezone_set);
PHP_FUNCTION(date_default_timezone_get);
+/* Astro functions */
+PHP_FUNCTION(date_sunrise);
+PHP_FUNCTION(date_sunset);
+PHP_FUNCTION(date_sun_info);
+
PHP_RINIT_FUNCTION(date);
PHP_RSHUTDOWN_FUNCTION(date);
PHP_MINIT_FUNCTION(date);
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/astro.c?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/date/lib/astro.c
diff -u php-src/ext/date/lib/astro.c:1.2 php-src/ext/date/lib/astro.c:1.3
--- php-src/ext/date/lib/astro.c:1.2 Sun Jan 1 13:09:48 2006
+++ php-src/ext/date/lib/astro.c Wed Jan 4 12:57:03 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: astro.c,v 1.2 2006/01/01 13:09:48 sniper Exp $ */
+/* $Id: astro.c,v 1.3 2006/01/04 12:57:03 derick Exp $ */
#include <stdio.h>
#include <math.h>
@@ -204,7 +204,7 @@
* both set to the time when the sun is at south.
*
*/
-int timelib_astro_rise_set_altitude(timelib_time *t_loc, double lon, double
lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll
*ts_rise, timelib_sll *ts_set)
+int timelib_astro_rise_set_altitude(timelib_time *t_loc, double lon, double
lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll
*ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit)
{
double d, /* Days since 2000 Jan 0.0 (negative before) */
sr, /* Solar distance, astronomical units */
@@ -215,11 +215,12 @@
tsouth, /* Time when Sun is at south */
sidtime; /* Local sidereal time */
timelib_time *t_utc;
- timelib_sll timestamp;
+ timelib_sll timestamp, old_sse;
int rc = 0; /* Return cde from function - usually 0 */
/* Normalize time */
+ old_sse = t_loc->sse;
t_loc->h = 12;
t_loc->i = t_loc->s = 0;
timelib_update_ts(t_loc, NULL);
@@ -258,6 +259,7 @@
{
double cost;
cost = (sind(altit) - sind(lat) * sind(sdec)) / (cosd(lat) *
cosd(sdec));
+ *ts_transit = t_utc->sse + (tsouth * 3600);
if (cost >= 1.0) {
rc = -1;
t = 0.0; /* Sun always below altit */
@@ -281,9 +283,9 @@
}
}
-
- /* Kill temporary time */
+ /* Kill temporary time and restore original sse */
timelib_time_dtor(t_utc);
+ t_loc->sse = old_sse;
return rc;
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_date.c?r1=1.52&r2=1.53&diff_format=u
Index: php-src/ext/date/lib/parse_date.c
diff -u php-src/ext/date/lib/parse_date.c:1.52
php-src/ext/date/lib/parse_date.c:1.53
--- php-src/ext/date/lib/parse_date.c:1.52 Sun Jan 1 13:09:48 2006
+++ php-src/ext/date/lib/parse_date.c Wed Jan 4 12:57:03 2006
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.9.12.dev on Mon Dec 19 13:18:44 2005 */
+/* Generated by re2c 0.9.12 on Wed Jan 4 13:49:18 2006 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_date.c,v 1.52 2006/01/01 13:09:48 sniper Exp $ */
+/* $Id: parse_date.c,v 1.53 2006/01/04 12:57:03 derick Exp $ */
#include "timelib.h"
@@ -588,7 +588,7 @@
timelib_tz_lookup_table *tp, *first_found_elem;
timelib_tz_lookup_table *fmp;
- if (strcasecmp("utc", word) == 0) {
+ if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
return timelib_timezone_utc;
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_date.re?r1=1.46&r2=1.47&diff_format=u
Index: php-src/ext/date/lib/parse_date.re
diff -u php-src/ext/date/lib/parse_date.re:1.46
php-src/ext/date/lib/parse_date.re:1.47
--- php-src/ext/date/lib/parse_date.re:1.46 Sun Jan 1 13:09:49 2006
+++ php-src/ext/date/lib/parse_date.re Wed Jan 4 12:57:04 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_date.re,v 1.46 2006/01/01 13:09:49 sniper Exp $ */
+/* $Id: parse_date.re,v 1.47 2006/01/04 12:57:04 derick Exp $ */
#include "timelib.h"
@@ -586,7 +586,7 @@
timelib_tz_lookup_table *tp, *first_found_elem;
timelib_tz_lookup_table *fmp;
- if (strcasecmp("utc", word) == 0) {
+ if (strcasecmp("utc", word) == 0 || strcasecmp("gmt", word) == 0) {
return timelib_timezone_utc;
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_tz.c?r1=1.24&r2=1.25&diff_format=u
Index: php-src/ext/date/lib/parse_tz.c
diff -u php-src/ext/date/lib/parse_tz.c:1.24
php-src/ext/date/lib/parse_tz.c:1.25
--- php-src/ext/date/lib/parse_tz.c:1.24 Sun Jan 1 13:09:49 2006
+++ php-src/ext/date/lib/parse_tz.c Wed Jan 4 12:57:04 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_tz.c,v 1.24 2006/01/01 13:09:49 sniper Exp $ */
+/* $Id: parse_tz.c,v 1.25 2006/01/04 12:57:04 derick Exp $ */
#include "timelib.h"
@@ -364,3 +364,21 @@
return tmp;
}
+
+timelib_sll timelib_get_current_offset(timelib_time *t)
+{
+ timelib_time_offset *gmt_offset;
+
+ switch (t->zone_type) {
+ case TIMELIB_ZONETYPE_ABBR:
+ case TIMELIB_ZONETYPE_OFFSET:
+ return t->z * 60;
+
+ case TIMELIB_ZONETYPE_ID:
+ gmt_offset = timelib_get_time_zone_info(t->sse,
t->tz_info);
+ return gmt_offset->offset;
+
+ default:
+ return 0;
+ }
+}
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/timelib.h?r1=1.19&r2=1.20&diff_format=u
Index: php-src/ext/date/lib/timelib.h
diff -u php-src/ext/date/lib/timelib.h:1.19 php-src/ext/date/lib/timelib.h:1.20
--- php-src/ext/date/lib/timelib.h:1.19 Sun Jan 1 13:09:49 2006
+++ php-src/ext/date/lib/timelib.h Wed Jan 4 12:57:04 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: timelib.h,v 1.19 2006/01/01 13:09:49 sniper Exp $ */
+/* $Id: timelib.h,v 1.20 2006/01/04 12:57:04 derick Exp $ */
#ifndef __TIMELIB_H__
#define __TIMELIB_H__
@@ -71,6 +71,7 @@
timelib_tzinfo *timelib_parse_tzfile(char *timezone, timelib_tzdb *tzdb);
int timelib_timestamp_is_in_dst(timelib_sll ts, timelib_tzinfo *tz);
timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo
*tz);
+timelib_sll timelib_get_current_offset(timelib_time *t);
void timelib_dump_tzinfo(timelib_tzinfo *tz);
timelib_tzdb *timelib_builtin_db(void);
timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int
*count);
@@ -96,6 +97,6 @@
/* from astro.c */
double timelib_ts_to_juliandate(timelib_sll ts);
-int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double
lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll
*ts_rise, timelib_sll *ts_set);
+int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double
lat, double altit, int upper_limb, double *h_rise, double *h_set, timelib_sll
*ts_rise, timelib_sll *ts_set, timelib_sll *ts_transit);
#endif
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/unixtime2tm.c?r1=1.15&r2=1.16&diff_format=u
Index: php-src/ext/date/lib/unixtime2tm.c
diff -u php-src/ext/date/lib/unixtime2tm.c:1.15
php-src/ext/date/lib/unixtime2tm.c:1.16
--- php-src/ext/date/lib/unixtime2tm.c:1.15 Sun Jan 1 13:09:49 2006
+++ php-src/ext/date/lib/unixtime2tm.c Wed Jan 4 12:57:04 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: unixtime2tm.c,v 1.15 2006/01/01 13:09:49 sniper Exp $ */
+/* $Id: unixtime2tm.c,v 1.16 2006/01/04 12:57:04 derick Exp $ */
#include "timelib.h"
@@ -170,9 +170,6 @@
timelib_time_offset *gmt_offset;
timelib_tzinfo *tz = tm->tz_info;
- tm->is_localtime = 1;
- tm->have_zone = 1;
-
switch (tm->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
case TIMELIB_ZONETYPE_OFFSET: {
@@ -203,7 +200,11 @@
default:
tm->is_localtime = 0;
tm->have_zone = 0;
+ return;
}
+
+ tm->is_localtime = 1;
+ tm->have_zone = 1;
}
void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz)
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/basic_functions.c?r1=1.745&r2=1.746&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.745
php-src/ext/standard/basic_functions.c:1.746
--- php-src/ext/standard/basic_functions.c:1.745 Wed Jan 4 12:22:23 2006
+++ php-src/ext/standard/basic_functions.c Wed Jan 4 12:57:04 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.745 2006/01/04 12:22:23 derick Exp $ */
+/* $Id: basic_functions.c,v 1.746 2006/01/04 12:57:04 derick Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -846,8 +846,6 @@
PHP_FE(output_add_rewrite_var,
NULL)
PHP_FE(output_reset_rewrite_vars,
NULL)
- PHP_FE(date_sunrise,
NULL)
- PHP_FE(date_sunset,
NULL)
{NULL, NULL, NULL}
};
@@ -885,10 +883,6 @@
PHP_INI_BEGIN()
PHP_INI_ENTRY_EX("safe_mode_protected_env_vars",
SAFE_MODE_PROTECTED_ENV_VARS, PHP_INI_SYSTEM, OnUpdateSafeModeProtectedEnvVars,
NULL)
PHP_INI_ENTRY_EX("safe_mode_allowed_env_vars",
SAFE_MODE_ALLOWED_ENV_VARS, PHP_INI_SYSTEM, OnUpdateSafeModeAllowedEnvVars,
NULL)
- PHP_INI_ENTRY("date.default_latitude", DATE_DEFAULT_LATITUDE,
PHP_INI_ALL, NULL)
- PHP_INI_ENTRY("date.default_longitude",
DATE_DEFAULT_LONGITUDE, PHP_INI_ALL, NULL)
- PHP_INI_ENTRY("date.sunset_zenith", DATE_SUNSET_ZENITH,
PHP_INI_ALL, NULL)
- PHP_INI_ENTRY("date.sunrise_zenith", DATE_SUNRISE_ZENITH,
PHP_INI_ALL, NULL)
PHP_INI_END()
@@ -1045,10 +1039,6 @@
REGISTER_LONG_CONSTANT("INI_SYSTEM", ZEND_INI_SYSTEM, CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("INI_ALL", ZEND_INI_ALL, CONST_CS |
CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("SUNFUNCS_RET_TIMESTAMP",
SUNFUNCS_RET_TIMESTAMP, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("SUNFUNCS_RET_STRING", SUNFUNCS_RET_STRING,
CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("SUNFUNCS_RET_DOUBLE", SUNFUNCS_RET_DOUBLE,
CONST_CS | CONST_PERSISTENT);
-
REGISTER_LONG_CONSTANT("PHP_URL_SCHEME", PHP_URL_SCHEME, CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_URL_HOST", PHP_URL_HOST, CONST_CS |
CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PHP_URL_PORT", PHP_URL_PORT, CONST_CS |
CONST_PERSISTENT);
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/config.m4?r1=1.82&r2=1.83&diff_format=u
Index: php-src/ext/standard/config.m4
diff -u php-src/ext/standard/config.m4:1.82 php-src/ext/standard/config.m4:1.83
--- php-src/ext/standard/config.m4:1.82 Thu Dec 22 11:02:51 2005
+++ php-src/ext/standard/config.m4 Wed Jan 4 12:57:04 2006
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.82 2005/12/22 11:02:51 tony2001 Exp $ -*- autoconf -*-
+dnl $Id: config.m4,v 1.83 2006/01/04 12:57:04 derick Exp $ -*- autoconf -*-
divert(3)dnl
@@ -489,7 +489,7 @@
incomplete_class.c url_scanner_ex.c
ftp_fopen_wrapper.c \
http_fopen_wrapper.c php_fopen_wrapper.c credits.c
css.c \
var_unserializer.c ftok.c sha1.c user_filters.c
uuencode.c \
- filters.c proc_open.c sunfuncs.c streamsfuncs.c
http.c)
+ filters.c proc_open.c streamsfuncs.c http.c)
PHP_ADD_MAKEFILE_FRAGMENT
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/config.w32?r1=1.5&r2=1.6&diff_format=u
Index: php-src/ext/standard/config.w32
diff -u php-src/ext/standard/config.w32:1.5 php-src/ext/standard/config.w32:1.6
--- php-src/ext/standard/config.w32:1.5 Thu Oct 6 13:03:29 2005
+++ php-src/ext/standard/config.w32 Wed Jan 4 12:57:04 2006
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.5 2005/10/06 13:03:29 derick Exp $
+// $Id: config.w32,v 1.6 2006/01/04 12:57:04 derick Exp $
ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files",
"");
AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);
@@ -15,6 +15,6 @@
versioning.c assert.c strnatcmp.c levenshtein.c incomplete_class.c \
url_scanner_ex.c ftp_fopen_wrapper.c http_fopen_wrapper.c \
php_fopen_wrapper.c credits.c css.c var_unserializer.c ftok.c sha1.c \
- user_filters.c uuencode.c filters.c proc_open.c sunfuncs.c \
+ user_filters.c uuencode.c filters.c proc_open.c \
streamsfuncs.c http.c", false /* never shared */);
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/php_standard.h?r1=1.25&r2=1.26&diff_format=u
Index: php-src/ext/standard/php_standard.h
diff -u php-src/ext/standard/php_standard.h:1.25
php-src/ext/standard/php_standard.h:1.26
--- php-src/ext/standard/php_standard.h:1.25 Sun Jan 1 13:09:55 2006
+++ php-src/ext/standard/php_standard.h Wed Jan 4 12:57:04 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_standard.h,v 1.25 2006/01/01 13:09:55 sniper Exp $ */
+/* $Id: php_standard.h,v 1.26 2006/01/04 12:57:04 derick Exp $ */
#include "basic_functions.h"
#include "php_math.h"
@@ -59,7 +59,6 @@
#include "php_versioning.h"
#include "php_ftok.h"
#include "php_type.h"
-#include "php_sunfuncs.h"
#define phpext_standard_ptr basic_functions_module_ptr
PHP_MINIT_FUNCTION(standard_filters);
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/general_functions/sunfuncts.phpt?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/standard/tests/general_functions/sunfuncts.phpt
diff -u php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.8
php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.9
--- php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.8 Sun Feb
13 19:23:53 2005
+++ php-src/ext/standard/tests/general_functions/sunfuncts.phpt Wed Jan 4
12:57:04 2006
@@ -18,27 +18,27 @@
}
?>
--EXPECT--
-1041316748 06:39 6.652455761896
-1041353169 16:46 16.76937486746
-1043994763 06:32 6.54537029266
-1044033183 17:13 17.21752470874
-1046412416 06:06 6.115652675685
-1046453799 17:36 17.6108549623
-1049088501 05:28 5.472742029069
-1049133501 17:58 17.97255258437
-1051678444 04:54 4.901229982859
-1051726729 18:18 18.31368876948
-1054355667 04:34 4.57442928945
-1054406363 18:39 18.65640094324
-1056947818 04:36 4.616120450519
-1056998911 18:48 18.80887165777
-1059627264 04:54 4.906882509836
-1059676557 18:35 18.59928600203
-1062306852 05:14 5.236889557074
-1062353017 18:03 18.06054178788
-1064899952 05:32 5.542366581139
-1064942681 17:24 17.41150561492
-1067579698 05:54 5.916208842058
-1067619001 16:50 16.83369857063
-1070173246 06:20 6.34622155207
-1070210100 16:35 16.58358905554
+1041395864 06:37 6.629013145891
+1041432452 16:47 16.79245111439
+1044073855 06:30 6.515408927984
+1044112463 17:14 17.23987028904
+1046491495 06:04 6.082214503339
+1046533075 17:37 17.63201103534
+1049167581 05:26 5.439443811173
+1049212774 17:59 17.99303572948
+1051757532 04:52 4.870193412616
+1051806007 18:20 18.33539050867
+1054434776 04:32 4.548982718277
+1054485647 18:40 18.67981294906
+1057026949 04:35 4.597195637274
+1057078197 18:49 18.83256339675
+1059706409 04:53 4.891657508917
+1059755837 18:37 18.62144070428
+1062385999 05:13 5.222095112101
+1062432291 18:04 18.08095716848
+1064979098 05:31 5.527319921542
+1065021952 17:25 17.43133913592
+1067658845 05:54 5.901629287093
+1067698274 16:51 16.85390245353
+1070252387 06:19 6.329924268934
+1070289382 16:36 16.60631260094
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php