FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17633&edit=1

ID: 17633
Updated by: ken@linux.ie
Reported By: will at willolbrys dot com
Summary: Speeding up Date_Holidays_Driver->getHolidayForDate
Status: Open
Type: Feature/Change Request
Package: Date_Holidays
Package Version: SVN
PHP Version: 5.3.3
-Assigned To:
+Assigned To: kguest
Roadmap Versions:
New Comment:

-Assigned To:
+Assigned To: kguest



Previous Comments:
------------------------------------------------------------------------

[2010-07-27 03:21:53] willolbrys

Added #patch
bug:17633;patch:speedup-getHolidayForDate;revision:1280200913;.

------------------------------------------------------------------------

[2010-07-27 03:17:51] willolbrys

Description:
------------
Since the basic Date_Holidays_Driver only contains one specific year, we
can speed up getHolidaysForDate by first checking that the
date/timestamp/etc has the correct year.

I just want to submit a tiny patch that makes this check:

if($date->getYear() != $this->_year){
return null;
}

It will make composite searches much faster since it wont bother
checking drivers that don't have the correct year specified. Since in
cases like the Composite Driver getHolidaysForDate is already
overwritten, this shouldnt affect any weird drivers you might make.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 28, '10 at 8:06a
activeJul 28, '10 at 8:06a
posts1
users1
websitepear.php.net

1 user in discussion

Ken: 1 post

People

Translate

site design / logo © 2022 Grokbase