├── .gitignore ├── .github └── FUNDING.yml ├── tests ├── stresstestfiles │ ├── TGC551.ged │ ├── TGC55C.ged │ ├── TGC551LF.ged │ └── TGC55CLF.ged ├── issue │ ├── files │ │ ├── issue00017.ged │ │ ├── issue00012.ged │ │ └── issue00018.ged │ ├── Issue00012Test.php │ ├── Issue00018Test.php │ └── Issue00017Test.php ├── phpunit.xml └── bootstrap.php ├── .travis.yml ├── library └── PhpGedcom │ ├── Parser │ ├── Indi │ │ ├── Bapl.php │ │ ├── Conl.php │ │ ├── Endl.php │ │ ├── Bapm.php │ │ ├── Barm.php │ │ ├── Basm.php │ │ ├── Bles.php │ │ ├── Buri.php │ │ ├── Cast.php │ │ ├── Cens.php │ │ ├── Chra.php │ │ ├── Conf.php │ │ ├── Crem.php │ │ ├── Deat.php │ │ ├── Dscr.php │ │ ├── Educ.php │ │ ├── Emig.php │ │ ├── Fcom.php │ │ ├── Grad.php │ │ ├── Idno.php │ │ ├── Immi.php │ │ ├── Nati.php │ │ ├── Natu.php │ │ ├── Nchi.php │ │ ├── Nmr.php │ │ ├── Occu.php │ │ ├── Ordn.php │ │ ├── Prob.php │ │ ├── Prop.php │ │ ├── Reli.php │ │ ├── Resi.php │ │ ├── Reti.php │ │ ├── Ssn.php │ │ ├── Titl.php │ │ ├── Will.php │ │ ├── Slgc.php │ │ ├── Birt.php │ │ ├── Chr.php │ │ ├── Adop.php │ │ ├── Fams.php │ │ ├── Even │ │ │ └── Plac.php │ │ └── Famc.php │ ├── Fam │ │ ├── Div.php │ │ ├── Anul.php │ │ ├── Cens.php │ │ ├── Divf.php │ │ ├── Enga.php │ │ ├── Marb.php │ │ ├── Marc.php │ │ ├── Marl.php │ │ ├── Marr.php │ │ ├── Mars.php │ │ ├── Even │ │ │ ├── Wife.php │ │ │ └── Husb.php │ │ └── Slgs │ │ │ └── Stat.php │ ├── Component.php │ ├── Date.php │ ├── Head │ │ ├── Plac.php │ │ ├── Gedc.php │ │ ├── Char.php │ │ ├── Date.php │ │ └── Sour │ │ │ ├── Data.php │ │ │ └── Corp.php │ ├── Phon.php │ ├── Plac │ │ ├── Map.php │ │ ├── Fone.php │ │ └── Romn.php │ ├── Sour │ │ ├── Data │ │ │ └── Even.php │ │ ├── Repo │ │ │ └── Caln.php │ │ └── Repo.php │ ├── SourRef │ │ ├── Data.php │ │ └── Even.php │ ├── Refn.php │ ├── Caln.php │ ├── ObjeRef │ │ ├── File.php │ │ └── File │ │ │ └── Form.php │ ├── Chan.php │ ├── ObjeRef.php │ ├── Addr.php │ └── RepoRef.php │ ├── Record │ ├── Indi │ │ ├── Bapl.php │ │ ├── Conl.php │ │ ├── Endl.php │ │ ├── Bapm.php │ │ ├── Barm.php │ │ ├── Basm.php │ │ ├── Bles.php │ │ ├── Buri.php │ │ ├── Cast.php │ │ ├── Cens.php │ │ ├── Chra.php │ │ ├── Conf.php │ │ ├── Crem.php │ │ ├── Deat.php │ │ ├── Dscr.php │ │ ├── Educ.php │ │ ├── Emig.php │ │ ├── Fcom.php │ │ ├── Grad.php │ │ ├── Idno.php │ │ ├── Immi.php │ │ ├── Nati.php │ │ ├── Natu.php │ │ ├── Nchi.php │ │ ├── Nmr.php │ │ ├── Occu.php │ │ ├── Ordn.php │ │ ├── Prob.php │ │ ├── Prop.php │ │ ├── Reli.php │ │ ├── Resi.php │ │ ├── Reti.php │ │ ├── Ssn.php │ │ ├── Titl.php │ │ ├── Will.php │ │ ├── Note.php │ │ ├── Slgc.php │ │ ├── Chr.php │ │ ├── Adop.php │ │ ├── Fams.php │ │ ├── Famc.php │ │ ├── Asso.php │ │ ├── Birt.php │ │ ├── Lds.php │ │ ├── Attr.php │ │ ├── Name.php │ │ └── Name │ │ │ ├── Fone.php │ │ │ └── Romn.php │ ├── Fam │ │ ├── Div.php │ │ ├── Anul.php │ │ ├── Cens.php │ │ ├── Enga.php │ │ ├── Marb.php │ │ ├── Marc.php │ │ ├── Marl.php │ │ ├── Marr.php │ │ ├── Mars.php │ │ ├── Even │ │ │ ├── Husb.php │ │ │ └── Wife.php │ │ ├── Slgs │ │ │ └── Stat.php │ │ ├── Slgs.php │ │ └── Even.php │ ├── Noteable.php │ ├── Objectable.php │ ├── Sourceable.php │ ├── Head │ │ ├── Plac.php │ │ ├── Char.php │ │ ├── Date.php │ │ ├── Sour │ │ │ ├── Data.php │ │ │ └── Corp.php │ │ ├── Gedc.php │ │ └── Sour.php │ ├── SourRef │ │ ├── Even.php │ │ └── Data.php │ ├── Sour │ │ ├── Data │ │ │ └── Even.php │ │ ├── Repo │ │ │ └── Caln.php │ │ ├── Data.php │ │ └── Repo.php │ ├── RepoRef.php │ ├── Plac │ │ ├── Map.php │ │ ├── Fone.php │ │ └── Romn.php │ ├── SourRef.php │ ├── ObjeRef │ │ ├── File.php │ │ └── File │ │ │ └── Form.php │ ├── ObjeRef.php │ ├── Note.php │ ├── NoteRef.php │ ├── Phon.php │ ├── Obje.php │ ├── Plac.php │ ├── Caln.php │ ├── Data.php │ ├── Refn.php │ ├── Chan.php │ └── Fam.php │ └── Writer │ ├── Phon.php │ ├── Indi │ ├── Attr.php │ ├── Fams.php │ ├── Famc.php │ ├── Asso.php │ └── Even │ │ └── Plac.php │ ├── Head │ ├── Plac.php │ ├── Gedc.php │ ├── Date.php │ ├── Char.php │ ├── Sour │ │ ├── Data.php │ │ └── Corp.php │ └── Sour.php │ ├── Fam │ └── Even │ │ ├── Husb.php │ │ └── Wife.php │ ├── Refn.php │ ├── Caln.php │ ├── Sour │ ├── Data │ │ └── Even.php │ └── Data.php │ ├── SourRef │ └── Even.php │ ├── NoteRef.php │ ├── Addr.php │ ├── Chan.php │ ├── RepoRef.php │ ├── ObjeRef.php │ └── Subn.php ├── composer.json └── LICENSE.md /.gitignore: -------------------------------------------------------------------------------- 1 | vendor/* 2 | .idea/* 3 | tmp/* -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: genealogiawebsite 2 | -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC551.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srsedev/php-gedcom/HEAD/tests/stresstestfiles/TGC551.ged -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC55C.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srsedev/php-gedcom/HEAD/tests/stresstestfiles/TGC55C.ged -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC551LF.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srsedev/php-gedcom/HEAD/tests/stresstestfiles/TGC551LF.ged -------------------------------------------------------------------------------- /tests/stresstestfiles/TGC55CLF.ged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/srsedev/php-gedcom/HEAD/tests/stresstestfiles/TGC55CLF.ged -------------------------------------------------------------------------------- /tests/issue/files/issue00017.ged: -------------------------------------------------------------------------------- 1 | 0 @P1232@ INDI 2 | 1 BIRT 3 | 2 DATE 1 May 1950 4 | 2 PLAC Chicago, Cook, Illinois, United States 5 | 1 NAME John Doe 6 | 1 FAMC 7 | 1 SEX M 8 | -------------------------------------------------------------------------------- /tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | library/Gedcom/ 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Bapl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Conl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Conl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Endl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Endl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Bapl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Bapl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Conl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Conl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Endl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Endl extends Lds 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Div.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Div extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Div.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Div extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Anul.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Anul extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Cens extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Divf.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Divf extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Enga.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Enga extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Marb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Marb extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Marc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Marc extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Marl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Marl extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Marr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Marr extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Mars.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam; 16 | 17 | class Mars extends \PhpGedcom\Parser\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Bapm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Bapm extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Barm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Barm extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Basm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Basm extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Bles.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Bles extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Buri.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Buri extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Cast.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Cast extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Cens extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Chra.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Chra extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Conf.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Conf extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Crem.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Crem extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Deat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Deat extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Dscr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Dscr extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Educ.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Educ extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Emig.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Emig extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Fcom.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Fcom extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Grad.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Grad extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Idno.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Idno extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Immi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Immi extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Nati.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Nati extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Natu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Natu extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Nchi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Nchi extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Nmr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Nmr extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Occu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Occu extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Ordn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Ordn extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Prob.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Prob extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Prop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Prop extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Reli.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Reli extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Resi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Resi extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Reti.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Reti extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Ssn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Ssn extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Titl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Titl extends \PhpGedcom\Parser\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Will.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Will extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Anul.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Anul extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Cens extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Enga.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Enga extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Marb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Marb extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Marc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Marc extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Marl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Marl extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Marr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Marr extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Mars.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | class Mars extends \PhpGedcom\Record\Fam\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Bapm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Bapm extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Barm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Barm extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Basm.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Basm extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Bles.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Bles extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Buri.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Buri extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Cast.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Cast extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Cens.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Cens extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Chra.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Chra extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Conf.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Conf extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Crem.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Crem extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Deat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Deat extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Dscr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Dscr extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Educ.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Educ extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Emig.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Emig extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Fcom.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Fcom extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Grad.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Grad extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Idno.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Idno extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Immi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Immi extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Nati.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Nati extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Natu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Natu extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Nchi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Nchi extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Nmr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Nmr extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Occu.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Occu extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Ordn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Ordn extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Prob.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Prob extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Prop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Prop extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Reli.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Reli extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Resi.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Resi extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Reti.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Reti extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Ssn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Ssn extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Titl.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Titl extends \PhpGedcom\Record\Indi\Attr 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Will.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Will extends \PhpGedcom\Record\Indi\Even 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Note.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Note extends \PhpGedcom\Record\NoteRefAbstract 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Slgc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Slgc extends Lds 18 | { 19 | protected $_famc = null; 20 | } 21 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Noteable.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | interface Noteable 18 | { 19 | public function addNote($note = []); 20 | } 21 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Objectable.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | interface Objectable 18 | { 19 | public function addObje($obje = []); 20 | } 21 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Sourceable.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | interface Sourceable 18 | { 19 | public function addSour($sour = []); 20 | } 21 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Head/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Head; 16 | 17 | class Plac extends \PhpGedcom\Record 18 | { 19 | protected $_form = null; 20 | } 21 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Even/Husb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam\Even; 16 | 17 | class Husb extends \PhpGedcom\Record 18 | { 19 | protected $_age = null; 20 | } 21 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Even/Wife.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam\Even; 16 | 17 | class Wife extends \PhpGedcom\Record 18 | { 19 | protected $_age = null; 20 | } 21 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Chr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Chr extends \PhpGedcom\Record\Indi\Even 18 | { 19 | protected $_famc = null; 20 | } 21 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "genealogiawebsite/php-gedcom", 3 | "description": "A GEDCOM file parser (read + write) for PHP 7.3+", 4 | "type": "library", 5 | "keywords": ["gedcom","parser"], 6 | "homepage": "http://github.com/genealogiawebsite/php-gedcom", 7 | "license": "MIT", 8 | "require": { 9 | "php": ">=7.3" 10 | }, 11 | "require-dev": { 12 | "phpunit/phpunit": "5.7.*", 13 | "squizlabs/php_codesniffer": "3.5.*" 14 | }, 15 | "autoload": { 16 | "psr-0": { 17 | "PhpGedcom\\": "library/" 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /tests/issue/Issue00012Test.php: -------------------------------------------------------------------------------- 1 | parse($sample); 18 | 19 | $indi = current($gedcom->getIndi()); 20 | $birt = current($indi->getEven()); 21 | 22 | $this->assertEquals('01.01.1970', $birt->getDate()); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Component.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | abstract class Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Head/Char.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Head; 16 | 17 | class Char extends \PhpGedcom\Record 18 | { 19 | protected $_char = null; 20 | protected $_vers = null; 21 | } 22 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Head/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Head; 16 | 17 | class Date extends \PhpGedcom\Record 18 | { 19 | protected $_date = null; 20 | protected $_time = null; 21 | } 22 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\SourRef; 16 | 17 | class Even extends \PhpGedcom\Record 18 | { 19 | protected $_even = null; 20 | protected $_role = null; 21 | } 22 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Adop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | class Adop extends \PhpGedcom\Record\Indi\Even 18 | { 19 | protected $_adop = null; 20 | protected $_famc = null; 21 | } 22 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Sour\Data; 16 | 17 | class Even extends \PhpGedcom\Record 18 | { 19 | protected $_date = null; 20 | protected $_plac = null; 21 | } 22 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Head/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Head\Sour; 16 | 17 | class Data extends \PhpGedcom\Record 18 | { 19 | protected $_data = null; 20 | protected $_date = null; 21 | protected $_copr = null; 22 | } 23 | -------------------------------------------------------------------------------- /tests/issue/Issue00018Test.php: -------------------------------------------------------------------------------- 1 | parse($sample); 21 | 22 | $sour = current($gedcom->getSour()); 23 | 24 | $this->assertCount(0, $sour->getNote()); 25 | $this->assertCount(1, $parser->getErrors()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tests/issue/Issue00017Test.php: -------------------------------------------------------------------------------- 1 | parse($sample); 21 | 22 | $indi = current($gedcom->getIndi()); 23 | 24 | $this->assertCount(0, $indi->getFamc()); 25 | $this->assertCount(1, $parser->getErrors()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Slgc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Slgc extends Lds 18 | { 19 | public static function parseFamc($parser, $slgc) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $slgc->setFamc($parser->normalizeIdentifier($record[2])); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/SourRef/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\SourRef; 16 | 17 | class Data extends \PhpGedcom\Record 18 | { 19 | /** 20 | * string entry_recording_date. 21 | */ 22 | protected $_date = null; 23 | /** 24 | * string text_from_source. 25 | */ 26 | protected $_text = null; 27 | } 28 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Sour/Repo/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Sour\Repo; 16 | 17 | class Caln extends \PhpGedcom\Record 18 | { 19 | /** 20 | * string source_call_number. 21 | */ 22 | protected $_caln = null; 23 | /** 24 | * string source_media_type. 25 | */ 26 | protected $_medi = null; 27 | } 28 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Head/Sour/Corp.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Head\Sour; 16 | 17 | class Corp extends \PhpGedcom\Record 18 | { 19 | protected $_corp = null; 20 | protected $_addr = null; 21 | 22 | protected $_phon = []; 23 | 24 | public function addPhon($phon = []) 25 | { 26 | $this->_phon[] = $phon; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Slgs/Stat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class RepoRef extends \PhpGedcom\Record implements Noteable 18 | { 19 | protected $_repo = null; 20 | 21 | protected $_caln = []; 22 | 23 | protected $_note = []; 24 | 25 | public function addNote($note = []) 26 | { 27 | $this->_note[] = $note; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Fams.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | 19 | class Fams extends \PhpGedcom\Record implements Noteable 20 | { 21 | protected $_fams = null; 22 | 23 | protected $_note = []; 24 | 25 | public function addNote($note = []) 26 | { 27 | $this->_note[] = $note; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Birt.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Birt extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | public static function parseFamc($parser, $even) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | if (isset($record[2])) { 23 | $even->setFamc(trim($record[2])); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Chr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Chr extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | public static function parseFamc($parser, $even) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | if (isset($record[2])) { 23 | $even->setFamc(trim($record[2])); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Plac/Map.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Plac; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class Map extends Record 23 | { 24 | /** 25 | * @var string place_latitude 26 | */ 27 | protected $lati; 28 | 29 | /** 30 | * @var string place_longitude 31 | */ 32 | protected $long; 33 | } 34 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Plac/Fone.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Plac; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class Fone extends Record 23 | { 24 | /** 25 | * @var string phonetic_variation 26 | */ 27 | protected $_fone; 28 | 29 | /** 30 | * @var string phonetic_type 31 | */ 32 | protected $_type; 33 | } 34 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Plac/Romn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Plac; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class Romn extends Record 23 | { 24 | /** 25 | * @var string romanized_variation 26 | */ 27 | protected $romn; 28 | 29 | /** 30 | * @var string romanized_type 31 | */ 32 | protected $type; 33 | } 34 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Famc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | 19 | class Famc extends \PhpGedcom\Record implements Noteable 20 | { 21 | protected $_famc = null; 22 | protected $_pedi = null; 23 | 24 | protected $_note = []; 25 | 26 | public function addNote($note = []) 27 | { 28 | $this->_note[] = $note; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Phon.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class Phon 18 | { 19 | /** 20 | * @param string $phon 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert($phon, $level = 1) 27 | { 28 | $output = "{$level} PHON ".$phon."\n"; 29 | 30 | return $output; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Indi/Attr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Indi; 16 | 17 | class Attr 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Indi\Attr $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Indi\Attr &$attr, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | return $output; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/SourRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class SourRef extends \PhpGedcom\Record 18 | { 19 | protected $_isRef = false; 20 | 21 | protected $_sour = null; 22 | protected $_page = null; 23 | protected $_even = null; 24 | protected $_data = null; 25 | protected $_quay = null; 26 | protected $_text = null; 27 | 28 | protected $_obje = []; 29 | protected $_note = []; 30 | } 31 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/ObjeRef/File.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\ObjeRef; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class File extends Record 23 | { 24 | /** 25 | * @var string multimedia_file_refn 26 | */ 27 | protected $_file; 28 | 29 | /** 30 | * @var PhpGedcom\Record\ObjeRef\File\Form 31 | */ 32 | protected $_form; 33 | protected $_titl; 34 | protected $_date; 35 | } 36 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Sour; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | 19 | class Data extends \PhpGedcom\Record implements Noteable 20 | { 21 | protected $_even = []; 22 | protected $_agnc = null; 23 | protected $_date = null; 24 | 25 | protected $_text = null; 26 | 27 | protected $_note = []; 28 | 29 | public function addNote($note = []) 30 | { 31 | $this->_note[] = $note; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/ObjeRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class ObjeRef extends \PhpGedcom\Record 18 | { 19 | protected $_isRef = false; 20 | 21 | protected $_obje = null; 22 | 23 | protected $_titl = null; 24 | 25 | protected $_file = null; 26 | 27 | public function setIsReference($isReference = true) 28 | { 29 | $this->_isRef = $isReference; 30 | } 31 | 32 | public function getIsReference() 33 | { 34 | return $this->_isRef; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/ObjeRef/File/Form.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\ObjeRef\File; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class Form extends Record 23 | { 24 | /** 25 | * @var string multimedia_format 26 | */ 27 | protected $_form; 28 | 29 | /** 30 | * @var string source_media_type 31 | * for only obje 32 | */ 33 | protected $_type; 34 | 35 | /** 36 | * @var string source_media_type 37 | * for only objeref 38 | */ 39 | protected $_medi; 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 2 | 3 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Asso.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | use PhpGedcom\Record\Sourceable; 19 | 20 | class Asso extends \PhpGedcom\Record implements Sourceable, Noteable 21 | { 22 | protected $_indi = null; 23 | protected $_rela = null; 24 | 25 | protected $_note = []; 26 | 27 | protected $_sour = []; 28 | 29 | public function addNote($note = []) 30 | { 31 | $this->_note[] = $note; 32 | } 33 | 34 | public function addSour($sour = []) 35 | { 36 | $this->_sour[] = $sour; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Note.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class Note extends \PhpGedcom\Record implements Sourceable 18 | { 19 | protected $_id = null; 20 | protected $_note = null; 21 | 22 | protected $_even = null; 23 | protected $_refn = []; 24 | protected $_rin = null; 25 | 26 | protected $_sour = []; 27 | protected $_chan = null; 28 | 29 | public function addRefn($refn = []) 30 | { 31 | $this->_refn[] = $refn; 32 | } 33 | 34 | public function addSour($sour = []) 35 | { 36 | $this->_sour[] = $sour; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/NoteRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class NoteRef extends \PhpGedcom\Record implements Sourceable 18 | { 19 | protected $_isRef = false; 20 | 21 | protected $_note = ''; 22 | 23 | protected $_sour = []; 24 | 25 | public function setIsReference($isReference = true) 26 | { 27 | $this->_isRef = $isReference; 28 | } 29 | 30 | public function getIsReference() 31 | { 32 | return $this->_isRef; 33 | } 34 | 35 | public function addSour($sour = []) 36 | { 37 | $this->_sour[] = $sour; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Birt.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | /** 18 | * Class Birt. 19 | */ 20 | class Birt extends Even 21 | { 22 | /** 23 | * @var string 24 | */ 25 | protected $famc; 26 | 27 | /** 28 | * @param string $famc 29 | * 30 | * @return Birt 31 | */ 32 | public function setFamc($famc = '') 33 | { 34 | $this->famc = $famc; 35 | 36 | return $this; 37 | } 38 | 39 | /** 40 | * @return string 41 | */ 42 | public function getFamc() 43 | { 44 | return $this->famc; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Adop.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Adop extends \PhpGedcom\Parser\Indi\Even 18 | { 19 | public static function parseAdop($parser, $even) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | if (isset($record[1])) { 23 | $even->setAdop(trim($record[2])); 24 | } 25 | } 26 | 27 | public static function parseFamc($parser, $even) 28 | { 29 | $record = $parser->getCurrentLineRecord(); 30 | if (isset($record[1])) { 31 | $even->setFamc(trim($record[2])); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Slgs.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | use PhpGedcom\Record\Sourceable; 19 | 20 | class Slgs extends \PhpGedcom\Record implements Sourceable, Noteable 21 | { 22 | protected $_stat; 23 | protected $_date; 24 | protected $_plac; 25 | protected $_temp; 26 | 27 | protected $_sour = []; 28 | 29 | protected $_note = []; 30 | 31 | public function addSour($sour = []) 32 | { 33 | $this->_sour[] = $sour; 34 | } 35 | 36 | public function addNote($note = []) 37 | { 38 | $this->_note[] = $note; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Phon.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Phon. 21 | */ 22 | class Phon extends Record 23 | { 24 | /** 25 | * @var string 26 | */ 27 | protected $phon = null; 28 | 29 | /** 30 | * @param $phon 31 | * 32 | * @return Phon 33 | */ 34 | public function setPhon($phon = []) 35 | { 36 | $this->phon = $phon; 37 | 38 | return $this; 39 | } 40 | 41 | /** 42 | * @return null|string 43 | */ 44 | public function getPhon() 45 | { 46 | return $this->phon; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Lds.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | use PhpGedcom\Record\Sourceable; 19 | 20 | abstract class Lds extends \PhpGedcom\Record implements Sourceable, Noteable 21 | { 22 | protected $_stat; 23 | protected $_date; 24 | protected $_plac; 25 | protected $_temp; 26 | 27 | protected $_sour = []; 28 | 29 | protected $_note = []; 30 | 31 | public function addSour($sour = []) 32 | { 33 | $this->_sour[] = $sour; 34 | } 35 | 36 | public function addNote($note = []) 37 | { 38 | $this->_note[] = $note; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Sour/Repo.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Sour; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | 19 | class Repo extends \PhpGedcom\Record implements Noteable 20 | { 21 | protected $_repo = null; 22 | /** 23 | * array PhpGedcom\Record\Sour\Repo\Caln. 24 | */ 25 | protected $_caln = []; 26 | 27 | /** 28 | * array PhpGedcom\Record\NoteRef. 29 | */ 30 | protected $_note = []; 31 | 32 | public function addNote($note = []) 33 | { 34 | $this->_note[] = $note; 35 | } 36 | 37 | public function addCaln($caln = []) 38 | { 39 | $this->_caln[] = $caln; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class Date extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[1])) { 24 | $dat = new \PhpGedcom\Record\Date(); 25 | if (!empty($record[2])) { 26 | $dat->setDate($record[2]); 27 | } 28 | } else { 29 | $parser->skipToNextLevel($depth); 30 | 31 | return null; 32 | } 33 | 34 | return $dat; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Head/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Head; 16 | 17 | class Plac 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Head\Plac $plac 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Head\Plac &$plac, $level) 27 | { 28 | $output = $level." PLAC \n"; 29 | 30 | // level up 31 | $level++; 32 | // FORM 33 | $form = $plac->getForm(); 34 | if ($form) { 35 | $output .= $level.' FORM '.$form."\n"; 36 | } 37 | 38 | return $output; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Fam/Even/Husb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Fam\Even; 16 | 17 | class Husb 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Fam\Even\Husb $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Fam\Even\Husb &$husb, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | $output .= $level." WIFE \n"; 30 | // level up 31 | $level++; 32 | 33 | // AGE 34 | $age = $husb->getAge(); 35 | if (!empty($age)) { 36 | $output .= $level.' AGE '.$age."\n"; 37 | } 38 | 39 | return $output; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Fam/Even/Wife.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Fam\Even; 16 | 17 | class Wife 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Fam\Even\Wife $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Fam\Even\Wife &$wife, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | $output .= $level." HUSB \n"; 30 | // level up 31 | $level++; 32 | 33 | // AGE 34 | $age = $wife->getAge(); 35 | if (!empty($age)) { 36 | $output .= $level.' AGE '.$age."\n"; 37 | } 38 | 39 | return $output; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Attr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | use PhpGedcom\Record\Objectable; 19 | use PhpGedcom\Record\Sourceable; 20 | 21 | class Attr extends \PhpGedcom\Record\Indi\Even implements Sourceable, Noteable, Objectable 22 | { 23 | protected $type = null; 24 | protected $_attr = null; 25 | 26 | protected $sour = []; 27 | 28 | protected $note = []; 29 | 30 | protected $obje = []; 31 | 32 | public function addSour($sour = []) 33 | { 34 | $this->sour[] = $sour; 35 | } 36 | 37 | public function addNote($note = []) 38 | { 39 | $this->note[] = $note; 40 | } 41 | 42 | public function addObje($obje = []) 43 | { 44 | $this->obje[] = $obje; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Obje.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class Obje extends \PhpGedcom\Record implements Noteable 18 | { 19 | protected $_id = null; 20 | 21 | protected $_file = []; 22 | protected $_rin = null; 23 | protected $_chan = null; 24 | 25 | protected $_refn = []; 26 | 27 | protected $_note = []; 28 | 29 | protected $_sour = []; 30 | 31 | public function addRefn($refn = []) 32 | { 33 | $this->_refn[] = $refn; 34 | } 35 | 36 | public function addNote($note = []) 37 | { 38 | $this->_note[] = $note; 39 | } 40 | 41 | public function addFile($file) 42 | { 43 | $this->_file[] = $file; 44 | } 45 | 46 | public function addSour($sour) 47 | { 48 | $this->_sour[] = $sour; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Refn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class Refn 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Refn $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Refn &$refn, $level) 26 | { 27 | $output = ''; 28 | $_refn = $refn->getRefn(); 29 | if (empty($_refn)) { 30 | return $output; 31 | } else { 32 | $output .= $level.' REFN '.$_refn."\n"; 33 | } 34 | // level up 35 | $level++; 36 | // DATE 37 | $type = $refn->getType(); 38 | if (!empty($type)) { 39 | $output .= $level.' TYPE '.$type."\n"; 40 | } 41 | 42 | return $output; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class Caln 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Caln $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Caln &$caln, $level) 26 | { 27 | $output = ''; 28 | $_caln = $caln->getCaln(); 29 | if (empty($_caln)) { 30 | return $output; 31 | } else { 32 | $output .= $level.' CALN '.$_caln."\n"; 33 | } 34 | 35 | // level up 36 | $level++; 37 | 38 | // medi 39 | $medi = $caln->getMedi(); 40 | if (!empty($medi)) { 41 | $output .= $level.' MEDI '.$medi."\n"; 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Head/Gedc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Head; 16 | 17 | class Gedc extends \PhpGedcom\Record 18 | { 19 | protected $_vers = null; 20 | 21 | protected $_form = null; 22 | 23 | /** 24 | * @return Gedc/version 25 | */ 26 | public function getVersion() 27 | { 28 | return $this->_vers; 29 | } 30 | 31 | /** 32 | * @param Gedc/version 33 | */ 34 | public function setVersion($vers = []) 35 | { 36 | $this->_vers = $vers; 37 | } 38 | 39 | /** 40 | * @return Gedc/form 41 | */ 42 | public function getForm() 43 | { 44 | return $this->_form; 45 | } 46 | 47 | /** 48 | * @param Gedc/version 49 | */ 50 | public function setForm($form = []) 51 | { 52 | $this->_form = $form; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Sour\Data; 16 | 17 | class Even 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Sour\Data\Even $even 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Sour\Data\Even &$even, $level) 26 | { 27 | $output = ''; 28 | 29 | $output = $level." EVEN\n"; 30 | $level++; 31 | 32 | // $date; 33 | $date = $even->getDate(); 34 | if (!empty($date)) { 35 | $output .= $level.' DATE '.$date."\n"; 36 | } 37 | 38 | // Plac 39 | $plac = $even->getPlac(); 40 | if (!empty($plac)) { 41 | $output .= $level.' PLAC '.$plac."\n"; 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Head/Gedc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Head; 16 | 17 | class Gedc 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Head\Gedc $gedc 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Head\Gedc &$gedc, $level) 27 | { 28 | $output = $level." GEDC \n"; 29 | 30 | // level up 31 | $level++; 32 | // VERS 33 | $vers = $gedc->getVersion(); 34 | if ($vers) { 35 | $output .= $level.' VERS '.$vers."\n"; 36 | } 37 | 38 | // FORM 39 | $form = $gedc->getForm(); 40 | if ($form) { 41 | $output .= $level.' FORM '.$form."\n"; 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Head/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Head; 16 | 17 | class Date 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Head\Date $date 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Head\Date &$date, $level) 27 | { 28 | $output = ''; 29 | $_date = $date->getDate(); 30 | if ($_date) { 31 | $output .= $level.' DATE '.$_date."\n"; 32 | } else { 33 | return $output; 34 | } 35 | 36 | // level up 37 | $level++; 38 | // Time 39 | $time = $date->getTime(); 40 | if ($time) { 41 | $output .= $level.' TIME '.$time."\n"; 42 | } 43 | 44 | return $output; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Head/Char.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Head; 16 | 17 | class Char 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Head\Char $char 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Head\Char &$char, $level) 27 | { 28 | $output = ''; 29 | // char 30 | $_char = $char->getChar(); 31 | if ($_char) { 32 | $output .= $level.' CHAR '.$_char."\n"; 33 | } else { 34 | return $output; 35 | } 36 | 37 | // level up 38 | $level++; 39 | // VERS 40 | $vers = $char->getVersion(); 41 | if ($vers) { 42 | $output .= $level.' VERS '.$vers."\n"; 43 | } 44 | 45 | return $output; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\SourRef; 16 | 17 | class Even 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\SourRef\Even $even 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\SourRef\Even &$even, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | // $_date; 30 | $_even = $even->getEven(); 31 | if (!empty($_even)) { 32 | $output .= $level.' EVEN '.$_even."\n"; 33 | } else { 34 | $output = $level." EVEN\n"; 35 | } 36 | // level up 37 | $level++; 38 | 39 | // $_role ROLE 40 | $_role = $data->getRole(); 41 | if (!empty($_role)) { 42 | $output .= $level.' ROLE '.$_role."\n"; 43 | } 44 | 45 | return $output; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/NoteRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class NoteRef 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\NoteRef $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\NoteRef &$note, $level) 26 | { 27 | $output = ''; 28 | 29 | // $_note 30 | $_note = $note->getNote(); 31 | if (!empty($_note)) { 32 | $output .= $level.' NOTE '.$_note."\n"; 33 | } 34 | 35 | $level++; 36 | // $sour 37 | $sour = $note->getSour(); 38 | if ($sour && count($sour) > 0) { 39 | foreach ($sour as $item) { 40 | $_convert = \PhpGedcom\Writer\SourRef::convert($item, $level); 41 | $output .= $_convert; 42 | } 43 | } 44 | 45 | return $output; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class Plac extends \PhpGedcom\Record implements Noteable 18 | { 19 | /** 20 | * string plac. 21 | */ 22 | protected $_plac = null; 23 | /** 24 | * string place_hierarchy. 25 | */ 26 | protected $_form = null; 27 | /** 28 | * array PhpGedcom\Record\Plac\Fone. 29 | */ 30 | protected $_fone = null; 31 | /** 32 | * array PhpGedcom\Record\Plac\Romn. 33 | */ 34 | protected $_romn = null; 35 | /** 36 | * PhpGedcom\Record\Plac\Map. 37 | */ 38 | protected $_map = null; 39 | /** 40 | * array PhpGedcom\Record\NoteRef. 41 | */ 42 | protected $_note = null; 43 | 44 | /** 45 | * @param PhpGedcom\Record\NoteRef $note 46 | * 47 | * @return Plac 48 | */ 49 | public function addNote($note = null) 50 | { 51 | $this->_note[] = $note; 52 | 53 | return $this; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Indi/Fams.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Indi; 16 | 17 | class Fams 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Indi\Fams $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Indi\Fams &$fams, $level = 0) 26 | { 27 | $output = ''; 28 | // NAME 29 | $_fams = $fams->getFams(); 30 | if (empty($_fams)) { 31 | return $output; 32 | } 33 | $output .= $level.' FAMS @'.$_fams."@\n"; 34 | // level up 35 | $level++; 36 | 37 | // note 38 | $note = $fams->getNote(); 39 | if (!empty($note) && count($note) > 0) { 40 | foreach ($note as $item) { 41 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 42 | $output .= $_convert; 43 | } 44 | } 45 | 46 | return $output; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Name.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi; 16 | 17 | /** 18 | * @method string getName() 19 | * @method string getNpfx() 20 | * @method string getGivn() 21 | * @method string getNick() 22 | * @method string getSpfx() 23 | * @method string getSurn() 24 | * @method string getNsfx() 25 | */ 26 | class Name extends \PhpGedcom\Record implements \PhpGedcom\Record\Sourceable 27 | { 28 | protected $_name = null; 29 | protected $_npfx = null; 30 | protected $_givn = null; 31 | protected $_nick = null; 32 | protected $_spfx = null; 33 | protected $_surn = null; 34 | protected $_nsfx = null; 35 | protected $_fone = null; // PhpGedcom/ 36 | protected $_romn = null; 37 | protected $_type = null; 38 | 39 | protected $_note = []; 40 | 41 | protected $_sour = []; 42 | 43 | public function addSour($sour = []) 44 | { 45 | $this->_sour[] = $sour; 46 | } 47 | 48 | public function addNote($note = []) 49 | { 50 | $this->_note[] = $note; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Caln. 21 | */ 22 | class Caln extends Record 23 | { 24 | /** 25 | * @var string 26 | */ 27 | protected $caln; 28 | 29 | /** 30 | * @var string 31 | */ 32 | protected $medi; 33 | 34 | /** 35 | * @param string $caln 36 | * 37 | * @return Caln 38 | */ 39 | public function setCaln($caln = '') 40 | { 41 | $this->caln = $caln; 42 | 43 | return $this; 44 | } 45 | 46 | /** 47 | * @return string 48 | */ 49 | public function getCaln() 50 | { 51 | return $this->caln; 52 | } 53 | 54 | /** 55 | * @param string $medi 56 | * 57 | * @return Caln 58 | */ 59 | public function setMedi($medi = '') 60 | { 61 | $this->medi = $medi; 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getMedi() 70 | { 71 | return $this->medi; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Data. 21 | */ 22 | class Data extends Record 23 | { 24 | /** 25 | * @var string 26 | */ 27 | protected $text; 28 | 29 | /** 30 | * @var string 31 | */ 32 | protected $date; 33 | 34 | /** 35 | * @param string $text 36 | * 37 | * @return Data 38 | */ 39 | public function setText($text = '') 40 | { 41 | $this->text = $text; 42 | 43 | return $this; 44 | } 45 | 46 | /** 47 | * @return string 48 | */ 49 | public function getText() 50 | { 51 | return $this->text; 52 | } 53 | 54 | /** 55 | * @param string $date 56 | * 57 | * @return Data 58 | */ 59 | public function setDate($date = '') 60 | { 61 | $this->date = $date; 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getDate() 70 | { 71 | return $this->date; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Refn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class Refn extends Record 23 | { 24 | /** 25 | * @var string 26 | */ 27 | protected $refn; 28 | 29 | /** 30 | * @var string 31 | */ 32 | protected $type; 33 | 34 | /** 35 | * @param string $refn 36 | * 37 | * @return Refn 38 | */ 39 | public function setRefn($refn = '') 40 | { 41 | $this->refn = $refn; 42 | 43 | return $this; 44 | } 45 | 46 | /** 47 | * @return string 48 | */ 49 | public function getRefn() 50 | { 51 | return $this->refn; 52 | } 53 | 54 | /** 55 | * @param string $type 56 | * 57 | * @return Refn 58 | */ 59 | public function setType($type = '') 60 | { 61 | $this->type = $type; 62 | 63 | return $this; 64 | } 65 | 66 | /** 67 | * @return string 68 | */ 69 | public function getType() 70 | { 71 | return $this->type; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Head/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Head\Sour; 16 | 17 | class Data 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Head\Sour\Data $data 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Head\Sour\Data &$data, $level) 27 | { 28 | $output = ''; 29 | $_data = $data->getData(); 30 | if ($_data) { 31 | $output .= $level.' DATA '.$_data."\n"; 32 | } else { 33 | return $output; 34 | } 35 | 36 | // level up 37 | $level++; 38 | 39 | // DATE 40 | $date = $corp->getDate(); 41 | if ($date) { 42 | $output .= $level.' DATE '.$date."\n"; 43 | } 44 | 45 | // COPR 46 | $corp = $corp->getCorp(); 47 | if ($corp) { 48 | $output .= $level.' COPR '.$corp."\n"; 49 | } 50 | 51 | return $output; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Addr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class Addr 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Addr $addr 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Addr &$addr, $format = self::GEDCOM55, $level = 1) 27 | { 28 | $addrs = explode("\n", $addr->getAddr()); 29 | 30 | $output = "{$level} ADDR ".$addrs[0]."\n"; 31 | 32 | array_shift($addrs); 33 | 34 | foreach ($addrs as $cont) { 35 | $output .= ($level + 1).' CONT '.$cont."\n"; 36 | } 37 | 38 | $output .= ($level + 1).' ADR1 '.$addr->adr1."\n". 39 | ($level + 1).' ADR2 '.$addr->getAdr2()."\n". 40 | ($level + 1).' CITY '.$addr->getCity()."\n". 41 | ($level + 1).' STAE '.$addr->getStae()."\n". 42 | ($level + 1).' POST '.$addr->getPost()."\n". 43 | ($level + 1).' CTRY '.$addr->getCtry()."\n"; 44 | 45 | return $output; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Chan.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class Chan 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Chan $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Chan &$chan, $level) 26 | { 27 | $output = $level." CHAN \n"; 28 | // level up 29 | $level++; 30 | // DATE 31 | $_date = $chan->getDate(); 32 | if (!empty($_date)) { 33 | $output .= $level.' DATE '.$_date."\n"; 34 | } 35 | // TIME 36 | $_time = $chan->getDate(); 37 | if (!empty($_time)) { 38 | $output .= $level.' DATE '.$_time."\n"; 39 | } 40 | // $_note = array() 41 | $_note = $chan->getNote(); 42 | if (!empty($_note) && count($_note) > 0) { 43 | foreach ($_note as $item) { 44 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 45 | $output .= $_convert; 46 | } 47 | } 48 | 49 | return $output; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Head/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Head; 16 | 17 | class Plac extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $plac = new \PhpGedcom\Record\Head\Plac(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'FORM': 40 | $plac->setForm(trim($record[2])); 41 | break; 42 | default: 43 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 44 | } 45 | 46 | $parser->forward(); 47 | } 48 | 49 | return $plac; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Indi/Famc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Indi; 16 | 17 | class Famc 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Indi\Famc $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Indi\Famc &$famc, $level = 0) 26 | { 27 | $output = ''; 28 | // NAME 29 | $_famc = $famc->getFams(); 30 | if (empty($_fams)) { 31 | return $output; 32 | } 33 | $output .= $level.' FAMC @'.$_famc."@\n"; 34 | // level up 35 | $level++; 36 | 37 | // PEDI 38 | $pedi = $famc->getPedi(); 39 | if (!empty($pedi)) { 40 | $output .= $level.' PEDI '.$pedi."\n"; 41 | } 42 | 43 | // note 44 | $note = $famc->getSour(); 45 | if (!empty($note) && count($note) > 0) { 46 | foreach ($note as $item) { 47 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 48 | $output .= $_convert; 49 | } 50 | } 51 | 52 | return $output; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Even/Wife.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam\Even; 16 | 17 | class Wife extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $wife = new \PhpGedcom\Record\Fam\Even\Wife(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'AGE': 40 | $wife->setAge(trim($record[2])); 41 | break; 42 | default: 43 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 44 | } 45 | 46 | $parser->forward(); 47 | } 48 | 49 | return $wife; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Even/Husb.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam\Even; 16 | 17 | class Husb extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $husband = new \PhpGedcom\Record\Fam\Even\Husb(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'AGE': 40 | $husband->setAge(trim($record[2])); 41 | break; 42 | default: 43 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 44 | } 45 | 46 | $parser->forward(); 47 | } 48 | 49 | return $husband; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Phon.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class Phon extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $phone = new \PhpGedcom\Record\Phon(); 25 | $phone->setPhon(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | default: 46 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $phone; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Plac/Map.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Plac; 16 | 17 | class Map extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $map = new \PhpGedcom\Record\Plac\Map(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $currentDepth = (int) $record[0]; 31 | $recordType = strtoupper(trim($record[1])); 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'LATI': 40 | $map->setLati(trim($record[2])); 41 | break; 42 | case 'LONG': 43 | $map->setLong(trim($record[2])); 44 | break; 45 | default: 46 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $map; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Head/Gedc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Head; 16 | 17 | class Gedc extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $gedc = new \PhpGedcom\Record\Head\Gedc(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'VERS': 40 | $gedc->setVersion(trim($record[2])); 41 | break; 42 | case 'FORM': 43 | $gedc->setForm(trim($record[2])); 44 | break; 45 | default: 46 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $gedc; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Sour/Data/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Sour\Data; 16 | 17 | class Even extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $even = new \PhpGedcom\Record\Sour\Data\Even(); 25 | 26 | $parser->forward(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = strtoupper(trim($record[1])); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $even->setDate(trim($record[2])); 41 | break; 42 | case 'PLAC': 43 | $even->setPlac(trim($record[2])); 44 | break; 45 | default: 46 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 47 | } 48 | 49 | $parser->forward(); 50 | } 51 | 52 | return $even; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/SourRef/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\SourRef; 16 | 17 | class Data extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $data = new \PhpGedcom\Record\SourRef\Data(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | 25 | $parser->forward(); 26 | 27 | while (!$parser->eof()) { 28 | $record = $parser->getCurrentLineRecord(); 29 | $recordType = strtoupper(trim($record[1])); 30 | $currentDepth = (int) $record[0]; 31 | 32 | if ($currentDepth <= $depth) { 33 | $parser->back(); 34 | break; 35 | } 36 | 37 | switch ($recordType) { 38 | case 'DATE': 39 | $data->setDate(trim($record[2])); 40 | break; 41 | case 'TEXT': 42 | $data->setText($parser->parseMultiLineRecord()); 43 | break; 44 | default: 45 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 46 | } 47 | 48 | $parser->forward(); 49 | } 50 | 51 | return $data; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/RepoRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class RepoRef 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\RepoRef $reporef 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\RepoRef &$reporef, $level) 26 | { 27 | $output = ''; 28 | $_repo = $reporef->getRepo(); 29 | if (empty($_sour)) { 30 | return $output; 31 | } else { 32 | $output .= $level.' REPO '.$_repo."\n"; 33 | } 34 | // level up 35 | $level++; 36 | 37 | // Note array 38 | $note = $reporef->getNote(); 39 | if (!empty($note) && count($note) > 0) { 40 | foreach ($note as $item) { 41 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 42 | $output .= $_convert; 43 | } 44 | } 45 | 46 | // _caln array 47 | $_caln = $reporef->getCaln(); 48 | if (!empty($_caln) && count($_caln) > 0) { 49 | foreach ($_caln as $item) { 50 | $_convert = \PhpGedcom\Writer\Caln::convert($item, $level); 51 | $output .= $_convert; 52 | } 53 | } 54 | 55 | return $output; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Sour/Repo/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Sour\Repo; 16 | 17 | class Caln extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $caln = new \PhpGedcom\Record\Sour\Repo\Caln(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $_caln = $record[2]; 26 | $caln->setCaln($_caln); 27 | } else { 28 | return null; 29 | } 30 | 31 | $parser->forward(); 32 | 33 | while (!$parser->eof()) { 34 | $record = $parser->getCurrentLineRecord(); 35 | $recordType = strtoupper(trim($record[1])); 36 | $currentDepth = (int) $record[0]; 37 | 38 | if ($currentDepth <= $depth) { 39 | $parser->back(); 40 | break; 41 | } 42 | 43 | switch ($recordType) { 44 | case 'MEDI': 45 | $caln->setMedi(trim($record[2])); 46 | break; 47 | default: 48 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 49 | } 50 | 51 | $parser->forward(); 52 | } 53 | 54 | return $caln; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Refn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class Refn extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $refn = new \PhpGedcom\Record\Refn(); 25 | $refn->setRefn(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'TYPE': 46 | $refn->setType(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $refn; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Caln.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class Caln extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $identifier = $parser->normalizeIdentifier($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $caln = new \PhpGedcom\Record\Caln(); 32 | $caln->setCaln($identifier); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $recordType = strtolower(trim($record[1])); 39 | $lineDepth = (int) $record[0]; 40 | 41 | if ($lineDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | if ($caln->hasAttribute($recordType)) { 47 | $caln->{'set'.$recordType}(trim($record[2])); 48 | } else { 49 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $caln; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Head/Sour/Corp.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Head\Sour; 16 | 17 | class Corp 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Head\Sour\Corp $corp 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Head\Sour\Corp &$corp, $level) 27 | { 28 | $output = ''; 29 | $_corp = $corp->getCorp(); 30 | if ($_corp) { 31 | $output .= $level.' CORP '.$_corp."\n"; 32 | } else { 33 | return $output; 34 | } 35 | 36 | // level up 37 | $level++; 38 | 39 | // ADDR 40 | $addr = $corp->getAddr(); 41 | if ($addr) { 42 | $_convert = \PhpGedcom\Writer\Addr::convert($addr, $level); 43 | $output .= $_convert; 44 | } 45 | 46 | // phon 47 | $phon = $corp->getPhon(); 48 | if ($phon && count($phon) > 0) { 49 | foreach ($phon as $item) { 50 | if ($item) { 51 | $_convert = \PhpGedcom\Writer\Phon::convert($item, $level); 52 | $output .= $_convert; 53 | } 54 | } 55 | } 56 | 57 | return $output; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Head/Char.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Head; 16 | 17 | class Char extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $char = new \PhpGedcom\Record\Head\Char(); 25 | $char->setChar(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'VERS': 46 | $char->setVers(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $char; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Head/Date.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Head; 16 | 17 | class Date extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $date = new \PhpGedcom\Record\Head\Date(); 25 | $date->setDate(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'TIME': 46 | $date->setTime(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $date; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/SourRef/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\SourRef; 16 | 17 | class Even extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $even = new \PhpGedcom\Record\SourRef\Even(); 25 | $even->setEven(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'ROLE': 46 | $even->setRole(trim($record[2])); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $even; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam/Even.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Fam; 16 | 17 | use PhpGedcom\Record\Noteable; 18 | use PhpGedcom\Record\Objectable; 19 | use PhpGedcom\Record\Sourceable; 20 | 21 | /** 22 | * Event record. 23 | * 24 | * @method mixed getType() 25 | * @method \PhpGedcom\Record\Date getDate() 26 | * @method string getPlac() 27 | */ 28 | class Even extends \PhpGedcom\Record implements Objectable, Sourceable, Noteable 29 | { 30 | protected $_type = null; 31 | protected $_date = null; 32 | protected $_plac = null; 33 | protected $_caus = null; 34 | protected $_age = null; 35 | 36 | protected $_addr = null; 37 | 38 | protected $_phon = []; 39 | 40 | protected $_agnc = null; 41 | 42 | protected $_husb = null; 43 | protected $_wife = null; 44 | 45 | protected $_obje = []; 46 | 47 | protected $_sour = []; 48 | 49 | protected $_note = []; 50 | 51 | public function addPhon($phon = []) 52 | { 53 | $this->_phon[] = $phon; 54 | } 55 | 56 | public function addObje($obje = []) 57 | { 58 | $this->_obje[] = $obje; 59 | } 60 | 61 | public function addSour($sour = []) 62 | { 63 | $this->_sour[] = $sour; 64 | } 65 | 66 | public function addNote($note = []) 67 | { 68 | $this->_note[] = $note; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Plac/Fone.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Plac; 16 | 17 | class Fone extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $_fone = trim($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $fone = new \PhpGedcom\Record\Plac\Fone(); 32 | $fone->setPlac($_fone); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $currentDepth = (int) $record[0]; 39 | $recordType = strtoupper(trim($record[1])); 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'TYPE': 48 | $fone->setType(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $fone; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Plac/Romn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Plac; 16 | 17 | class Romn extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $_romn = trim($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $romn = new \PhpGedcom\Record\Plac\Romn(); 32 | $romn->setPlac($_romn); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $currentDepth = (int) $record[0]; 39 | $recordType = strtoupper(trim($record[1])); 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'TYPE': 48 | $romn->setType(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $romn; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Name/Fone.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi\Name; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class Fone extends Record 23 | { 24 | /** 25 | * @var string phonetic_variation 26 | */ 27 | protected $fone; 28 | 29 | /** 30 | * @var string phonetic_type 31 | */ 32 | protected $type; 33 | /** 34 | * string name_piece_prefix. 35 | */ 36 | protected $_npfx = null; 37 | /** 38 | * string name_piece_given. 39 | */ 40 | protected $_givn = null; 41 | /** 42 | * string name_piece_nickname. 43 | */ 44 | protected $_nick = null; 45 | /** 46 | * strign name_piece_surname_prefix. 47 | */ 48 | protected $_spfx = null; 49 | /** 50 | * string name_piece_surname. 51 | */ 52 | protected $_surn = null; 53 | /** 54 | * string name_piece_suffix. 55 | */ 56 | protected $_nsfx = null; 57 | 58 | /** 59 | * PhpGedcom\Record\NoteRef. 60 | */ 61 | protected $_note = []; 62 | 63 | /** 64 | * PhpGedcom\Record\SourRef. 65 | */ 66 | protected $_sour = []; 67 | 68 | public function addSour($sour = []) 69 | { 70 | $this->_sour[] = $sour; 71 | } 72 | 73 | public function addNote($note = []) 74 | { 75 | $this->_note[] = $note; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Indi/Name/Romn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Indi\Name; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Refn. 21 | */ 22 | class Romn extends Record 23 | { 24 | /** 25 | * @var string romanized_variation 26 | */ 27 | protected $romn; 28 | 29 | /** 30 | * @var string romanized_type 31 | */ 32 | protected $type; 33 | /** 34 | * string name_piece_prefix. 35 | */ 36 | protected $_npfx = null; 37 | /** 38 | * string name_piece_given. 39 | */ 40 | protected $_givn = null; 41 | /** 42 | * string name_piece_nickname. 43 | */ 44 | protected $_nick = null; 45 | /** 46 | * strign name_piece_surname_prefix. 47 | */ 48 | protected $_spfx = null; 49 | /** 50 | * string name_piece_surname. 51 | */ 52 | protected $_surn = null; 53 | /** 54 | * string name_piece_suffix. 55 | */ 56 | protected $_nsfx = null; 57 | 58 | /** 59 | * PhpGedcom\Record\NoteRef. 60 | */ 61 | protected $_note = []; 62 | 63 | /** 64 | * PhpGedcom\Record\SourRef. 65 | */ 66 | protected $_sour = []; 67 | 68 | public function addSour($sour = []) 69 | { 70 | $this->_sour[] = $sour; 71 | } 72 | 73 | public function addNote($note = []) 74 | { 75 | $this->_note[] = $note; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Fam/Slgs/Stat.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Fam\Slgs; 16 | 17 | class Stat extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $_stat = $record[2]; 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $stat = new \PhpGedcom\Record\Fam\Slgs\Stat(); 32 | $stat->setStat($_stat); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $recordType = strtoupper(trim($record[1])); 39 | $currentDepth = (int) $record[0]; 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'DATE': 48 | $stat->setDate(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $stat; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/ObjeRef/File.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\ObjeRef; 16 | 17 | class File extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $file = new \PhpGedcom\Record\ObjeRef\File(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $file->setFile($record[2]); 26 | } else { 27 | return null; 28 | } 29 | $parser->forward(); 30 | 31 | while (!$parser->eof()) { 32 | $record = $parser->getCurrentLineRecord(); 33 | $recordType = strtoupper(trim($record[1])); 34 | $currentDepth = (int) $record[0]; 35 | 36 | if ($currentDepth <= $depth) { 37 | $parser->back(); 38 | break; 39 | } 40 | 41 | switch ($recordType) { 42 | case 'FORM': 43 | $file->setDate(\PhpGedcom\Parser\ObjeRef\File\Form::parse($parser)); 44 | break; 45 | case 'TITL': 46 | $file->setTitl(trim($record[2])); 47 | default: 48 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 49 | } 50 | 51 | $parser->forward(); 52 | } 53 | 54 | return $file; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Indi/Asso.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Indi; 16 | 17 | class Asso 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Indi\Asso $attr 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Indi\Asso &$asso, $level = 0) 26 | { 27 | $output = ''; 28 | // _indi 29 | $_indi = $asso->getIndi(); 30 | if (empty($_indi)) { 31 | return $output; 32 | } 33 | $output .= $level.' ASSO '.$_indi."\n"; 34 | // level up 35 | $level++; 36 | 37 | // RELA 38 | $rela = $asso->getRela(); 39 | if (!empty($rela)) { 40 | $output .= $level.' RELA '.$rela."\n"; 41 | } 42 | // sour 43 | $sour = $asso->getSour(); 44 | if (!empty($sour) && count($sour) > 0) { 45 | foreach ($sour as $item) { 46 | $_convert = \PhpGedcom\Writer\SourRef::convert($item, $level); 47 | $output .= $_convert; 48 | } 49 | } 50 | 51 | // note 52 | $note = $asso->getSour(); 53 | if (!empty($note) && count($note) > 0) { 54 | foreach ($note as $item) { 55 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 56 | $output .= $_convert; 57 | } 58 | } 59 | 60 | return $output; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Sour/Repo.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Sour; 16 | 17 | class Repo extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $repo = new \PhpGedcom\Record\Sour\Repo(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $_repo = $parser->normalizeIdentifier($record[2]); 26 | $repo->setRepo($_repo); 27 | } 28 | 29 | $parser->forward(); 30 | 31 | while (!$parser->eof()) { 32 | $record = $parser->getCurrentLineRecord(); 33 | $recordType = strtoupper(trim($record[1])); 34 | $currentDepth = (int) $record[0]; 35 | 36 | if ($currentDepth <= $depth) { 37 | $parser->back(); 38 | break; 39 | } 40 | 41 | switch ($recordType) { 42 | case 'NOTE': 43 | $repo->addNote(\PhpGedcom\Parser\NoteRef::parse($parser)); 44 | break; 45 | case 'CALN': 46 | $repo->addCaln(\PhpGedcom\Parser\Sour\Repo\Caln::parse($parser)); 47 | break; 48 | default: 49 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 50 | } 51 | 52 | $parser->forward(); 53 | } 54 | 55 | return $repo; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/ObjeRef/File/Form.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\ObjeRef\File; 16 | 17 | class Form extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $form = new \PhpGedcom\Record\ObjeRef\File\Form(); 22 | $record = $parser->getCurrentLineRecord(); 23 | $depth = (int) $record[0]; 24 | if (isset($record[2])) { 25 | $form->setForm($record[2]); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | $parser->forward(); 32 | 33 | while (!$parser->eof()) { 34 | $record = $parser->getCurrentLineRecord(); 35 | $recordType = strtoupper(trim($record[1])); 36 | $currentDepth = (int) $record[0]; 37 | 38 | if ($currentDepth <= $depth) { 39 | $parser->back(); 40 | break; 41 | } 42 | 43 | switch ($recordType) { 44 | case 'MEDI': 45 | $form->setMedi(trim($record[2])); 46 | break; 47 | case 'TYPE': 48 | $form->setType(trim($record[2])); 49 | break; 50 | default: 51 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 52 | } 53 | 54 | $parser->forward(); 55 | } 56 | 57 | return $form; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Head/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Head\Sour; 16 | 17 | class Data extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $data = new \PhpGedcom\Record\Head\Sour\Data(); 25 | $data->setData(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'DATE': 46 | $data->setDate(trim($record[2])); 47 | break; 48 | case 'COPR': 49 | $data->setCopr(trim($record[2])); 50 | break; 51 | default: 52 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 53 | } 54 | 55 | $parser->forward(); 56 | } 57 | 58 | return $data; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Head/Sour.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Head; 16 | 17 | class Sour 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Head\Sour $sour 21 | * @param string $format 22 | * @param int $level 23 | * 24 | * @return string 25 | */ 26 | public static function convert(\PhpGedcom\Record\Head\Sour &$sour, $level) 27 | { 28 | $output = ''; 29 | $_sour = $sour->getSour(); 30 | if ($_sour) { 31 | $output .= $level.' SOUR '.$_sour."\n"; 32 | } else { 33 | return $output; 34 | } 35 | 36 | // level up 37 | $level++; 38 | 39 | // VERS 40 | $vers = $sour->getVersion(); 41 | if ($vers) { 42 | $output .= $level.' VERS '.$vers."\n"; 43 | } 44 | 45 | // NAME 46 | $name = $sour->getName(); 47 | if ($name) { 48 | $output .= $level.' NAME '.$name."\n"; 49 | } 50 | 51 | // CORP 52 | $corp = $sour->getCorp(); 53 | if ($corp) { 54 | $_convert = \PhpGedcom\Writer\Head\Sour\Corp::convert($corp, $level); 55 | $output .= $_convert; 56 | } 57 | 58 | // DATA 59 | $data = $sour->getData(); 60 | if ($data) { 61 | $_convert = \PhpGedcom\Writer\Head\Sour\Data::convert($data, $level); 62 | $output .= $_convert; 63 | } 64 | 65 | return $output; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Chan.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class Chan extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $parser->forward(); 25 | 26 | $chan = new \PhpGedcom\Record\Chan(); 27 | 28 | while (!$parser->eof()) { 29 | $record = $parser->getCurrentLineRecord(); 30 | $recordType = trim($record[1]); 31 | $currentDepth = (int) $record[0]; 32 | 33 | if ($currentDepth <= $depth) { 34 | $parser->back(); 35 | break; 36 | } 37 | 38 | switch ($recordType) { 39 | case 'DATE': 40 | $chan->setDate(trim($record[2])); 41 | break; 42 | case 'TIME': 43 | $chan->setTime(trim($record[2])); 44 | break; 45 | case 'NOTE': 46 | $note = \PhpGedcom\Parser\NoteRef::parse($parser); 47 | if ($note) { 48 | $chan->addNote($note); 49 | } 50 | break; 51 | default: 52 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 53 | } 54 | 55 | $parser->forward(); 56 | } 57 | 58 | return $chan; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Head/Sour/Corp.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Head\Sour; 16 | 17 | class Corp extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $corp = new \PhpGedcom\Record\Head\Sour\Corp(); 25 | $corp->setCorp(trim($record[2])); 26 | } else { 27 | $parser->skipToNextLevel($depth); 28 | 29 | return null; 30 | } 31 | 32 | $parser->forward(); 33 | 34 | while (!$parser->eof()) { 35 | $record = $parser->getCurrentLineRecord(); 36 | $recordType = strtoupper(trim($record[1])); 37 | $currentDepth = (int) $record[0]; 38 | 39 | if ($currentDepth <= $depth) { 40 | $parser->back(); 41 | break; 42 | } 43 | 44 | switch ($recordType) { 45 | case 'ADDR': 46 | $corp->setAddr(\PhpGedcom\Parser\Addr::parse($parser)); 47 | break; 48 | case 'PHON': 49 | $corp->addPhon(trim($record[2])); 50 | break; 51 | default: 52 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 53 | } 54 | 55 | $parser->forward(); 56 | } 57 | 58 | return $corp; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/ObjeRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class ObjeRef 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\ObjeRef $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\ObjeRef &$obje, $level) 26 | { 27 | $output = ''; 28 | 29 | // $_note 30 | $_obje = $obje->getObje(); 31 | if (!empty($_note)) { 32 | $output .= $level.' OBJE '.$_obje."\n"; 33 | } else { 34 | $output .= $level." OBJE \n"; 35 | } 36 | 37 | $level++; 38 | // _form 39 | $_form = $obje->getForm(); 40 | if (!empty($_form)) { 41 | $output .= $level.' FORM '.$_form."\n"; 42 | } 43 | 44 | // _titl 45 | $_titl = $obje->getTitl(); 46 | if (!empty($_titl)) { 47 | $output .= $level.' TITL '.$_titl."\n"; 48 | } 49 | 50 | // _file 51 | $_file = $obje->getFile(); 52 | if (!empty($_file)) { 53 | $output .= $level.' FILE '.$_file."\n"; 54 | } 55 | 56 | // $_note = array() 57 | $_note = $obje->getNote(); 58 | if (!empty($_note) && count($_note) > 0) { 59 | foreach ($_note as $item) { 60 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 61 | $output .= $_convert; 62 | } 63 | } 64 | 65 | return $output; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/ObjeRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class ObjeRef extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $obje = new \PhpGedcom\Record\ObjeRef(); 25 | 26 | if (isset($record[2])) { 27 | $obje->setIsReference(true); 28 | $obje->setObje($parser->normalizeIdentifier($record[2])); 29 | } else { 30 | $obje->setIsReference(false); 31 | } 32 | 33 | $parser->forward(); 34 | 35 | while (!$parser->eof()) { 36 | $record = $parser->getCurrentLineRecord(); 37 | $recordType = strtoupper(trim($record[1])); 38 | $currentDepth = (int) $record[0]; 39 | 40 | if ($currentDepth <= $depth) { 41 | $parser->back(); 42 | break; 43 | } 44 | 45 | switch ($recordType) { 46 | case 'TITL': 47 | $obje->setTitl(trim($record[2])); 48 | break; 49 | case 'FILE': 50 | $obje->setFile(\PhpGedcom\Parser\ObjeRef\File::parse($parser)); 51 | break; 52 | default: 53 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 54 | } 55 | 56 | $parser->forward(); 57 | } 58 | 59 | return $obje; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Indi/Even/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Indi\Even; 16 | 17 | class Plac 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Indi\Even\Plac $plac 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Indi\Even\Plac &$plac, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | // $plac 30 | $_plac = $plac->getPlac(); 31 | if (!empty($_plac)) { 32 | $output .= $level.' PLAC '.$_plac."\n"; 33 | } else { 34 | $output .= $level." PLAC\n"; 35 | } 36 | 37 | // level up 38 | $level++; 39 | 40 | // $form 41 | $form = $plac->getForm(); 42 | if (!empty($form)) { 43 | $output .= $level.' FORM '.$form."\n"; 44 | } 45 | 46 | // $note -array 47 | $note = $plac->getNote(); 48 | if ($note && count($note) > 0) { 49 | foreach ($note as $item) { 50 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 51 | $output .= $_convert; 52 | } 53 | } 54 | // $sour -array 55 | $sour = $plac->getSour(); 56 | if ($sour && count($sour) > 0) { 57 | foreach ($sour as $item) { 58 | $_convert = \PhpGedcom\Writer\SourRef::convert($item, $level); 59 | $output .= $_convert; 60 | } 61 | } 62 | 63 | return $output; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Chan.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | use PhpGedcom\Record; 18 | 19 | /** 20 | * Class Chan. 21 | */ 22 | class Chan extends Record 23 | { 24 | /** 25 | * @var string 26 | */ 27 | protected $date; 28 | 29 | /** 30 | * @var string 31 | */ 32 | protected $time; 33 | 34 | /** 35 | * @var array 36 | */ 37 | protected $note = []; 38 | 39 | /** 40 | * @param string $date 41 | * 42 | * @return Chan 43 | */ 44 | public function setDate($date = '') 45 | { 46 | $this->date = $date; 47 | 48 | return $this; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function getDate() 55 | { 56 | return $this->date; 57 | } 58 | 59 | /** 60 | * @param Record\NoteRef $note 61 | * 62 | * @return Chan 63 | */ 64 | public function addNote($note = []) 65 | { 66 | $this->note[] = $note; 67 | 68 | return $this; 69 | } 70 | 71 | /** 72 | * @return array 73 | */ 74 | public function getNote() 75 | { 76 | return $this->note; 77 | } 78 | 79 | /** 80 | * @param string $time 81 | * 82 | * @return Chan 83 | */ 84 | public function setTime($time = '') 85 | { 86 | $this->time = $time; 87 | 88 | return $this; 89 | } 90 | 91 | /** 92 | * @return string 93 | */ 94 | public function getTime() 95 | { 96 | return $this->time; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Addr.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class Addr extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | $line = isset($record[2]) ? trim($record[2]) : ''; 24 | 25 | $addr = new \PhpGedcom\Record\Addr(); 26 | $addr->setAddr($line); 27 | $parser->forward(); 28 | 29 | while (!$parser->eof()) { 30 | $record = $parser->getCurrentLineRecord(); 31 | $recordType = strtolower(trim($record[1])); 32 | $currentDepth = (int) $record[0]; 33 | 34 | if ($currentDepth <= $depth) { 35 | $parser->back(); 36 | break; 37 | } 38 | 39 | if ($addr->hasAttribute($recordType)) { 40 | $addr->{'set'.$recordType}(trim($record[2])); 41 | } else { 42 | if ($recordType == 'cont') { 43 | // FIXME: Can have CONT on multiple attributes 44 | $addr->setAddr($addr->getAddr()."\n"); 45 | if (isset($record[2])) { 46 | $addr->setAddr($addr->getAddr().trim($record[2])); 47 | } 48 | } else { 49 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 50 | } 51 | } 52 | 53 | $parser->forward(); 54 | } 55 | 56 | return $addr; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Fams.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Fams extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | if (count($record) < 3) { 25 | $parser->logSkippedRecord('Missing family information; '.get_class(), ' @ '.__LINE__); 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $fams = $parser->normalizeIdentifier($record[2]); 32 | 33 | $fam = new \PhpGedcom\Record\Indi\Fams(); 34 | $fam->setFams($fams); 35 | 36 | $parser->forward(); 37 | 38 | while (!$parser->eof()) { 39 | $record = $parser->getCurrentLineRecord(); 40 | $recordType = strtoupper(trim($record[1])); 41 | $currentDepth = (int) $record[0]; 42 | 43 | if ($currentDepth <= $depth) { 44 | $parser->back(); 45 | break; 46 | } 47 | 48 | switch ($recordType) { 49 | case 'NOTE': 50 | $note = \PhpGedcom\Parser\NoteRef::parse($parser); 51 | if ($note) { 52 | $fam->addNote($note); 53 | } 54 | break; 55 | default: 56 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 57 | } 58 | 59 | $parser->forward(); 60 | } 61 | 62 | return $fam; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Head/Sour.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record\Head; 16 | 17 | class Sour extends \PhpGedcom\Record 18 | { 19 | protected $_sour = null; 20 | 21 | protected $_vers = null; 22 | 23 | protected $_name = null; 24 | 25 | protected $_corp = null; 26 | 27 | protected $_data = null; 28 | 29 | /** 30 | * @param Sour\Corp $corp 31 | */ 32 | public function setCorp($corp = []) 33 | { 34 | $this->_corp = $corp; 35 | } 36 | 37 | /** 38 | * @return Sour\Corp 39 | */ 40 | public function getCorp() 41 | { 42 | return $this->_corp; 43 | } 44 | 45 | /** 46 | * @param \PhpGedcom\Record\Head\Sour\Data $data 47 | */ 48 | public function setData($data = []) 49 | { 50 | $this->_data = $data; 51 | } 52 | 53 | /** 54 | * @return \PhpGedcom\Record\Head\Sour\Data 55 | */ 56 | public function getData() 57 | { 58 | return $this->_data; 59 | } 60 | 61 | /** 62 | * @return Sour\Name 63 | */ 64 | public function getName() 65 | { 66 | return $this->_name; 67 | } 68 | 69 | /** 70 | * @param Sour\Name 71 | */ 72 | public function setName($name = []) 73 | { 74 | $this->_name = $name; 75 | } 76 | 77 | /** 78 | * @return Sour\Version 79 | */ 80 | public function getVersion() 81 | { 82 | return $this->_vers; 83 | } 84 | 85 | /** 86 | * @param Sour\Version 87 | */ 88 | public function setVersion($version = []) 89 | { 90 | $this->_vers = $version; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Sour/Data.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer\Sour; 16 | 17 | class Data 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Sour\Data $data 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Sour\Data &$data, $level = 0) 26 | { 27 | $output = ''; 28 | 29 | $output = $level." DATA\n"; 30 | $level++; 31 | 32 | // $_date; 33 | $date = $data->getDate(); 34 | if (!empty($date)) { 35 | $output .= $level.' DATE '.$date."\n"; 36 | } 37 | 38 | // $_agnc AGNC 39 | $_agnc = $data->getAgnc(); 40 | if (!empty($_agnc)) { 41 | $output .= $level.' AGNC '.$_agnc."\n"; 42 | } 43 | 44 | // $_text 45 | $_text = $data->getText(); 46 | if (!empty($_text)) { 47 | $output .= $level.' TEXT '.$_text."\n"; 48 | } 49 | 50 | // $_note 51 | $note = $data->getNote(); 52 | if ($note && count($note) > 0) { 53 | foreach ($note as $item) { 54 | $_convert = \PhpGedcom\Writer\NoteRef::convert($item, $level); 55 | $output .= $_convert; 56 | } 57 | } 58 | 59 | // $_even 60 | $_even = $data->getEven(); 61 | if ($_even && count($_even) > 0) { 62 | foreach ($_even as $item) { 63 | $_convert = \PhpGedcom\Writer\Sour\Data\Even::convert($item, $level); 64 | $output .= $_convert; 65 | } 66 | } 67 | 68 | return $output; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/RepoRef.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser; 16 | 17 | class RepoRef extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | if (isset($record[2])) { 24 | $identifier = $parser->normalizeIdentifier($record[2]); 25 | } else { 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $repo = new \PhpGedcom\Record\RepoRef(); 32 | $repo->setRepo($identifier); 33 | 34 | $parser->forward(); 35 | 36 | while (!$parser->eof()) { 37 | $record = $parser->getCurrentLineRecord(); 38 | $currentDepth = (int) $record[0]; 39 | $recordType = strtoupper(trim($record[1])); 40 | 41 | if ($currentDepth <= $depth) { 42 | $parser->back(); 43 | break; 44 | } 45 | 46 | switch ($recordType) { 47 | case 'CALN': 48 | $repo->addCaln(\PhpGedcom\Parser\Caln::parse($parser)); 49 | break; 50 | case 'NOTE': 51 | $note = \PhpGedcom\Parser\NoteRef::parse($parser); 52 | if ($note) { 53 | $repo->addNote($note); 54 | } 55 | break; 56 | default: 57 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 58 | } 59 | 60 | $parser->forward(); 61 | } 62 | 63 | return $repo; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Even/Plac.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi\Even; 16 | 17 | class Plac extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | $plac = new \PhpGedcom\Record\Indi\Even\Plac(); 25 | 26 | if (isset($record[2])) { 27 | $plac->setPlac(trim($record[2])); 28 | } 29 | 30 | $parser->forward(); 31 | 32 | while (!$parser->eof()) { 33 | $record = $parser->getCurrentLineRecord(); 34 | $recordType = strtoupper(trim($record[1])); 35 | $currentDepth = (int) $record[0]; 36 | 37 | if ($currentDepth <= $depth) { 38 | $parser->back(); 39 | break; 40 | } 41 | 42 | switch ($recordType) { 43 | case 'FORM': 44 | $plac->setForm(trim($record[2])); 45 | break; 46 | case 'NOTE': 47 | $note = \PhpGedcom\Parser\NoteRef::parse($parser); 48 | if ($note) { 49 | $plac->addNote($note); 50 | } 51 | break; 52 | case 'SOUR': 53 | $sour = \PhpGedcom\Parser\SourRef::parse($parser); 54 | $plac->addSour($sour); 55 | break; 56 | default: 57 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 58 | } 59 | 60 | $parser->forward(); 61 | } 62 | 63 | return $plac; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /library/PhpGedcom/Parser/Indi/Famc.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Parser\Indi; 16 | 17 | class Famc extends \PhpGedcom\Parser\Component 18 | { 19 | public static function parse(\PhpGedcom\Parser $parser) 20 | { 21 | $record = $parser->getCurrentLineRecord(); 22 | $depth = (int) $record[0]; 23 | 24 | if (count($record) < 3) { 25 | $parser->logSkippedRecord('Missing family information; '.get_class(), ' @ '.__LINE__); 26 | $parser->skipToNextLevel($depth); 27 | 28 | return null; 29 | } 30 | 31 | $famc = $parser->normalizeIdentifier($record[2]); 32 | 33 | $fam = new \PhpGedcom\Record\Indi\Famc(); 34 | $fam->setFamc($famc); 35 | 36 | $parser->forward(); 37 | 38 | while (!$parser->eof()) { 39 | $record = $parser->getCurrentLineRecord(); 40 | $recordType = strtoupper(trim($record[1])); 41 | $currentDepth = (int) $record[0]; 42 | 43 | if ($currentDepth <= $depth) { 44 | $parser->back(); 45 | break; 46 | } 47 | 48 | switch ($recordType) { 49 | case 'PEDI': 50 | $fam->setPedi(trim($record[2])); 51 | break; 52 | case 'NOTE': 53 | $note = \PhpGedcom\Parser\NoteRef::parse($parser); 54 | if ($note) { 55 | $fam->addNote($note); 56 | } 57 | break; 58 | default: 59 | $parser->logUnhandledRecord(get_class().' @ '.__LINE__); 60 | } 61 | 62 | $parser->forward(); 63 | } 64 | 65 | return $fam; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /library/PhpGedcom/Record/Fam.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Kristopher Wilson 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Record; 16 | 17 | class Fam extends \PhpGedcom\Record implements Noteable, Sourceable, Objectable 18 | { 19 | protected $_id = null; 20 | 21 | protected $_resn = null; 22 | 23 | protected $_even = []; 24 | 25 | protected $_husb = null; 26 | 27 | protected $_wife = null; 28 | 29 | protected $_chil = []; 30 | 31 | protected $_nchi = null; 32 | 33 | protected $_subm = []; 34 | 35 | protected $_slgs = []; 36 | 37 | protected $_refn = []; 38 | 39 | protected $_rin = null; 40 | 41 | protected $_chan = null; 42 | 43 | protected $_note = []; 44 | 45 | protected $_sour = []; 46 | 47 | protected $_obje = []; 48 | 49 | public function addEven($even) 50 | { 51 | $this->_even[$even->getType()] = $even; 52 | } 53 | 54 | /** 55 | * @return array 56 | */ 57 | public function getAllEven() 58 | { 59 | return $this->_even; 60 | } 61 | 62 | /** 63 | * @return void|\PhpGedcom\Record\Fam\Even 64 | */ 65 | public function getEven($key = '') 66 | { 67 | if (isset($this->_even[strtoupper($key)])) { 68 | return $this->_even[strtoupper($key)]; 69 | } 70 | } 71 | 72 | public function addSlgs($slgs = []) 73 | { 74 | $this->_slgs[] = $slgs; 75 | } 76 | 77 | public function addRefn($refn = []) 78 | { 79 | $this->_refn[] = $refn; 80 | } 81 | 82 | public function addNote($note = []) 83 | { 84 | $this->_note[] = $note; 85 | } 86 | 87 | public function addSour($sour = []) 88 | { 89 | $this->_sour[] = $sour; 90 | } 91 | 92 | public function addObje($obje = []) 93 | { 94 | $this->_obje[] = $obje; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /library/PhpGedcom/Writer/Subn.php: -------------------------------------------------------------------------------- 1 | 9 | * @copyright Copyright (c) 2010-2013, Xiang Ming 10 | * @license MIT 11 | * 12 | * @link http://github.com/mrkrstphr/php-gedcom 13 | */ 14 | 15 | namespace PhpGedcom\Writer; 16 | 17 | class Subn 18 | { 19 | /** 20 | * @param \PhpGedcom\Record\Subn $note 21 | * @param int $level 22 | * 23 | * @return string 24 | */ 25 | public static function convert(\PhpGedcom\Record\Subn &$subn) 26 | { 27 | $level = 0; 28 | $output = ''; 29 | $_subn = $subn->getSubn(); 30 | if (empty($_subn)) { 31 | return $output; 32 | } else { 33 | $output .= $level.' '.$_subn." SUBN \n"; 34 | } 35 | // level up 36 | $level++; 37 | 38 | // SUBM 39 | $subm = $subn->getSubm(); 40 | if (!empty($subm)) { 41 | $output .= $level.' SUBM '.$subm."\n"; 42 | } 43 | 44 | // FAMF 45 | $famf = $subn->getFamf(); 46 | if (!empty($famf)) { 47 | $output .= $level.' FAMF '.$famf."\n"; 48 | } 49 | 50 | // TEMP 51 | $temp = $subn->getTemp(); 52 | if (!empty($temp)) { 53 | $output .= $level.' TEMP '.$temp."\n"; 54 | } 55 | 56 | // ANCE 57 | $ance = $subn->getAnce(); 58 | if (!empty($ance)) { 59 | $output .= $level.' ANCE '.$ance."\n"; 60 | } 61 | 62 | // DESC 63 | $desc = $subn->getDesc(); 64 | if (!empty($desc)) { 65 | $output .= $level.' DESC '.$desc."\n"; 66 | } 67 | // ORDI 68 | $ordi = $subn->getOrdi(); 69 | if (!empty($ordi)) { 70 | $output .= $level.' ORDI '.$ordi."\n"; 71 | } 72 | 73 | // RIN 74 | $rin = $subn->getRin(); 75 | if (!empty($rin)) { 76 | $output .= $level.' RIN '.$rin."\n"; 77 | } 78 | 79 | return $output; 80 | } 81 | } 82 | --------------------------------------------------------------------------------