Narretz / php-gedcom

PHP library for parsing gedcom genealogy files into objects
Other
3 stars 8 forks source link

Fixed fam/husb/age in parser. Added option to fetch specific family/person/etc. from gedcom. #1

Open stuporglue opened 12 years ago

stuporglue commented 12 years ago

Fixed fam/husb/age in parser. Added option to fetch specific family/person/etc. from gedcom.

Narretz commented 12 years ago

Hi, thanks for your pull requests. I am a little busy at the moment, and cannot review them in detail now.

One thing about the option to request specific "objects":I personally didn't see the use case for this, as I always saw php-gedcom as the starting point for further processing. So I wouldn't go much further than getting an id, because then you might think "Oh, might as well get the last (highest) id, or a range etc. These ORM-like functions should in my opinion go into another library that further processes the data. Do you have any more plans in this direction?

stuporglue commented 12 years ago

I don't have any specific plans for that at the moment. Right now I just need to be able to fetch a single specific individual, and then I spider from there to return a subset of the tree centered around that individual.

I didn't want to have to copy each of the object type arrays to directly access specific object IDs. I suppose the alternative would be to pass the parser constructor an object which extends the Gedcom class with the methods I need.

If you'd rather keep php-gedcom light that might be better. In that case only accept the pull request for "Fixed parsing husb/wife age" as that does fix an actual parser bug.

To reproduce that bug, use allged.ged from here: http://heiner-eichmann.de/gedcom/allged.htm

Here's the project I'm working on: http://stuporglue.org/familyhistory/Pedigree-Viewer-dev/

It's an HTML5 pedigree viewer. Right now it's pretty limited, but it will soon be able to move through the GEDCOM. I've got a wrapper script that takes a starting person ID and the number of ancestor and descendant generations and returns just that portion of the GEDCOM in the JSON format that Pedigree-Viewer expects.

Thanks Michael