Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66316 invoked from network); 11 Jun 2009 18:00:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jun 2009 18:00:21 -0000 Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 63.205.162.117 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 63.205.162.117 us-mr1.zend.com Linux 2.4/2.6 Received: from [63.205.162.117] ([63.205.162.117:33159] helo=us-mr1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/6D-01167-036413A4 for ; Thu, 11 Jun 2009 14:00:19 -0400 Received: from us-gw1.zend.com (us-ex1.zend.net [192.168.16.5]) by us-mr1.zend.com (Postfix) with ESMTP id 12269E12C4; Thu, 11 Jun 2009 10:49:48 -0700 (PDT) Received: from [192.168.16.83] ([192.168.16.83]) by us-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 11 Jun 2009 11:00:34 -0700 Message-ID: <4A31462B.1070302@zend.com> Date: Thu, 11 Jun 2009 11:00:11 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: 'PHP Internals' CC: Derick Rethans Content-Type: multipart/mixed; boundary="------------010502060108040206040301" X-OriginalArrivalTime: 11 Jun 2009 18:00:34.0889 (UTC) FILETIME=[84C3F390:01C9EABE] Subject: bug #48247 again From: stas@zend.com (Stanislav Malyshev) --------------010502060108040206040301 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi! Bug #48247 appears to be not entirely fixed still, it still produces a torrent of warnings in certain configs (namely, take php.ini-production and edit it to enable error_log, don't touch anything else - I get 400K worth of warnings). Attached patch should fix it. Please tell if there's some objection to it, otherwise I'll commit it tomorrow. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com --------------010502060108040206040301 Content-Type: text/plain; name="date.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="date.diff" ? date.diff Index: php_date.c =================================================================== RCS file: /repository/php-src/ext/date/php_date.c,v retrieving revision 1.43.2.45.2.51.2.78 diff -u -r1.43.2.45.2.51.2.78 php_date.c --- php_date.c 31 May 2009 21:28:38 -0000 1.43.2.45.2.51.2.78 +++ php_date.c 11 Jun 2009 17:58:26 -0000 @@ -591,6 +591,7 @@ date_globals->default_timezone = NULL; date_globals->timezone = NULL; date_globals->tzcache = NULL; + date_globals->guessing_tz = 0; } /* }}} */ @@ -610,6 +611,7 @@ } DATEG(timezone) = NULL; DATEG(tzcache) = NULL; + DATEG(guessing_tz) = 0; return SUCCESS; } @@ -858,8 +860,11 @@ if (! tzid) { tzid = "UTC"; } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta ? ta->tm_zone : "Unknown", ta ? (float) (ta->tm_gmtoff / 3600) : 0, ta ? (ta->tm_isdst ? "DST" : "no DST") : "Unknown"); + if(DATEG(guessing_tz) < 1) { + DATEG(guessing_tz) = 1; + php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%s/%.1f/%s' instead", tzid, ta ? ta->tm_zone : "Unknown", ta ? (float) (ta->tm_gmtoff / 3600) : 0, ta ? (ta->tm_isdst ? "DST" : "no DST") : "Unknown"); + DATEG(guessing_tz) = 0; + } return tzid; } #endif @@ -878,7 +883,11 @@ if (! tzid) { tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); + if(DATEG(guessing_tz) < 1) { + DATEG(guessing_tz) = 1; + php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/no DST' instead", tzid, ((tzi.Bias + tzi.StandardBias) / -60.0)); + DATEG(guessing_tz) = 0; + } break; /* DST in effect */ @@ -892,7 +901,11 @@ if (! tzid) { tzid = "UTC"; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); + if(DATEG(guessing_tz) < 1) { + DATEG(guessing_tz) = 1; + php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We selected '%s' for '%.1f/DST' instead", tzid, ((tzi.Bias + tzi.DaylightBias) / -60.0)); + DATEG(guessing_tz) = 0; + } break; } return tzid; @@ -907,7 +920,11 @@ } #endif /* Fallback to UTC */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); + if(DATEG(guessing_tz) < 1) { + DATEG(guessing_tz) = 1; + php_error_docref(NULL TSRMLS_CC, E_WARNING, DATE_TZ_ERRMSG "We had to select 'UTC' because your platform doesn't provide functionality for the guessing algorithm"); + DATEG(guessing_tz) = 0; + } return "UTC"; } Index: php_date.h =================================================================== RCS file: /repository/php-src/ext/date/php_date.h,v retrieving revision 1.17.2.11.2.3.2.13 diff -u -r1.17.2.11.2.3.2.13 php_date.h --- php_date.h 31 May 2009 21:28:38 -0000 1.17.2.11.2.3.2.13 +++ php_date.h 11 Jun 2009 17:58:26 -0000 @@ -151,6 +151,7 @@ char *timezone; HashTable *tzcache; timelib_error_container *last_errors; + int guessing_tz; ZEND_END_MODULE_GLOBALS(date) #ifdef ZTS --------------010502060108040206040301--