From a3161aa091264561ac07cabb15f506e2a80d1d28 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Mon, 27 Sep 2010 01:19:57 +0000 Subject: [PATCH] Removed a TSRMLS_FETCH() call in php_idate() in favor of the TSRMLS macros --- UPGRADING.INTERNALS | 6 +++++- ext/date/php_date.c | 5 ++--- ext/date/php_date.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index bfbfa533e0..a4e3c83b9c 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -99,4 +99,8 @@ Use emalloc, emalloc_rel, efree or efree_rel instead. . php_get_current_user PHPAPI php_get_current_user(TSRMLS_D) - Call: char *user = php_get_current_user(TSRMLS_C); \ No newline at end of file + Call: char *user = php_get_current_user(TSRMLS_C); + +. php_idate + PHPAPI php_idate(char format, time_t ts, int localtime TSRMLS_DC) + Call: int ret = php_idate(format, ts, localtime TSRMLS_CC) \ No newline at end of file diff --git a/ext/date/php_date.c b/ext/date/php_date.c index e6d14fd27e..8a35f9586b 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1203,7 +1203,7 @@ PHPAPI char *php_format_date(char *format, int format_len, time_t ts, int localt /* {{{ php_idate */ -PHPAPI int php_idate(char format, time_t ts, int localtime) +PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC) { timelib_time *t; timelib_tzinfo *tzi; @@ -1214,7 +1214,6 @@ PHPAPI int php_idate(char format, time_t ts, int localtime) t = timelib_time_ctor(); if (!localtime) { - TSRMLS_FETCH(); tzi = get_timezone_info(TSRMLS_C); t->tz_info = tzi; t->zone_type = TIMELIB_ZONETYPE_ID; @@ -1336,7 +1335,7 @@ PHP_FUNCTION(idate) ts = time(NULL); } - ret = php_idate(format[0], ts, 0); + ret = php_idate(format[0], ts, 0 TSRMLS_CC); if (ret == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unrecognized date format token."); RETURN_FALSE; diff --git a/ext/date/php_date.h b/ext/date/php_date.h index 09755060c2..cf7acada4d 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -163,7 +163,7 @@ ZEND_END_MODULE_GLOBALS(date) /* Backwards compability wrapper */ PHPAPI signed long php_parse_date(char *string, signed long *now); PHPAPI void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gmt); -PHPAPI int php_idate(char format, time_t ts, int localtime); +PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC); #if HAVE_STRFTIME #define _php_strftime php_strftime PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm); -- 2.40.0