5 * Reads birthday reminder 2's birthday files (.bdf).
11 public function __construct($filename)
13 $this->filename = $filename;
14 if (!file_exists($this->filename)) {
16 'Birthday file does not exist: ' . $this->filename
22 * @param string $strDate Date the events shall be found for, YYYY-MM-DD
24 public function getEvents($strDate, $nDaysBefore, $nDaysAfter)
26 $x = simplexml_load_file($this->filename);
29 foreach ($x->content->person as $xPerson) {
33 explode('.', (string) $xPerson->date)
37 (string) $xPerson->name,
38 (string) $xPerson->event,
41 if ($event->isWithin($strDate, $nDaysBefore, $nDaysAfter)) {