Re: [PEPr] Comment on Date and Time::Date_Holidays

From: Date: Sun, 20 Jun 2004 14:17:15 +0000
Subject: Re: [PEPr] Comment on Date and Time::Date_Holidays
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-30954@lists.php.net to get a copy of this message
Hi,
Just a few suggestions: don't store holidays in the class, but provide a method to import them from a datasource (.ini file, database, whatever). The class should provide some baked data files as examples, [...] Also, the final user probably prefers handling simple text files than writing new classes just to add a few holidays: I agree with Stephan's opinion here (we decided together to go the driver based way). The user can restrict the results of methods to those holidays he want (see next paragraph) and the Composite-Driver helps to combine several drivers. If someone is missing holidays in a driver I he would have to contact the author of the driver. But i think this thats good this way, because other people could benefit from that.
but the final user must be able to customize his data (maybe he wants to filter some holidays out). Well, filtering out holidays you're not interested in works already. You can see that here - http://pear.tool-garage.de/Date_Holidays/examples-src/. Many methods accept an $restrict array, that may contain internalNames of holidays. If provided, they will just return result-values for those ones.
Is there any difference between Date_Holidays_Driver_Christian::_calcEaster() and the php function easter_date()? [5] easter_date() returns a timestamp and I tried to avoid using timestamps in the package.
Some other pedantic notes: - please always use english names ($jahr => $year) My mistake, I will change this as soon as possible. ;-)
- Even if the studlyCaps convention for holiday names is ok, they should start with a capital letter ('petrusAndPaulus' => 'PetrusAndPaulus') I will do this just after I corrected the bug with those ugly german-named variables.
Regards, Carsten

« previous php.pear.dev (#30954) next »