<?php namespace Geneanet; require_once __DIR__ . "/autoload.php"; error_reporting(E_ALL); if (isset($argv[1])) { $file = $argv[1]; } else { usage(); exit(0); } $writer = new GedcomWriter($cnf = null); echo $writer->unpretty(file_get_contents($file));
$test = 'descendants'; switch ($test) { case 'single': $p = $grabber->grabSingle($url); echo utf8_decode($p); break; case 'ascendants': $p = $grabber->grabSingle($url); $grabber->grabAscendants($p, $level = 3); break; case 'descendants': $p = $grabber->grabSingle($url); $grabber->grabDescendants($p, $level = 2); break; } # print_r($p); $writer = new GedcomWriter($config); # for debug # echo utf8_decode($writer->pretty($writer->write($p))); # it seems that geneanet do not support UTF8 switch ($config->get('gedcom/charset')) { case 'UTF-8': case 'UTF8': echo $writer->write($p); break; default: # default charset to ISO8859-15 (ok on Linux) echo utf8_decode($writer->write($p)); break; } # echo $writer->write($p);