Home
last modified time | relevance | path

Searched refs:gedcom (Results 1 – 25 of 216) sorted by relevance

123456789

/webtrees/app/Factories/
H A DGedcomRecordFactory.php49 public function make(string $xref, Tree $tree, string|null $gedcom = null): GedcomRecord|null argument
52 if ($gedcom !== null && preg_match('/^0(?: @[^@]+@)? ([A-Z_]+)/', $gedcom, $match)) {
55 return Registry::familyFactory()->make($xref, $tree, $gedcom);
57 return Registry::headerFactory()->make($xref, $tree, $gedcom);
59 return Registry::individualFactory()->make($xref, $tree, $gedcom);
61 return Registry::locationFactory()->make($xref, $tree, $gedcom);
63 return Registry::mediaFactory()->make($xref, $tree, $gedcom);
65 return Registry::noteFactory()->make($xref, $tree, $gedcom);
67 return Registry::repositoryFactory()->make($xref, $tree, $gedcom);
69 return Registry::sourceFactory()->make($xref, $tree, $gedcom);
[all …]
H A DFamilyFactory.php44 * @param string|null $gedcom
48 public function make(string $xref, Tree $tree, string|null $gedcom = null): Family|null argument
50 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
51 $gedcom ??= $this->gedcom($xref, $tree);
54 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
58 $xref = $this->extractXref($gedcom ?? $pending, $xref);
61 …preg_match_all('/\n1 (?:HUSB|WIFE|CHIL) @(' . Gedcom::REGEX_XREF . ')@/', $gedcom . "\n" . $pendin…
68 return $this->new($xref, $gedcom ?? '', $pending, $tree);
88 * @param string $gedcom an empty string for new/pending records
95 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Family argument
[all …]
H A DIndividualFactory.php43 * @param string|null $gedcom
47 public function make(string $xref, Tree $tree, string|null $gedcom = null): Individual|null argument
49 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
50 $gedcom ??= $this->gedcom($xref, $tree);
53 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
56 $xref = $this->extractXref($gedcom ?? $pending, $xref);
58 return $this->new($xref, $gedcom ?? '', $pending, $tree);
78 * @param string $gedcom an empty string for new/pending records
85 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Individual argument
87 return new Individual($xref, $gedcom, $pending, $tree);
[all …]
H A DSharedNoteFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): SharedNote|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return new SharedNote($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): SharedNote argument
82 return new SharedNote($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\SharedNoteFactory
H A DSubmissionFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): Submission|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return $this->new($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Submission argument
82 return new Submission($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\SubmissionFactory
H A DNoteFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): Note|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return new Note($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Note argument
82 return new Note($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\NoteFactory
H A DHeaderFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): Header|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return $this->new($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Header argument
82 return new Header($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\HeaderFactory
H A DMediaFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): Media|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return $this->new($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Media argument
82 return new Media($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\MediaFactory
H A DLocationFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): Location|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return $this->new($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Location argument
82 return new Location($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\LocationFactory
H A DSourceFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): Source|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return $this->new($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Source argument
82 return new Source($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\SourceFactory
H A DSubmitterFactory.php41 public function make(string $xref, Tree $tree, string|null $gedcom = null): Submitter|null argument
43 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
44 $gedcom ??= $this->gedcom($xref, $tree);
47 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
51 $xref = $this->extractXref($gedcom ?? $pending, $xref);
53 return $this->new($xref, $gedcom ?? '', $pending, $tree);
73 * @param string $gedcom an empty string for new/pending records
80 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Submitter argument
82 return new Submitter($xref, $gedcom, $pending, $tree);
93 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\SubmitterFactory
H A DRepositoryFactory.php42 public function make(string $xref, Tree $tree, string|null $gedcom = null): Repository|null argument
44 …rray()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) {
45 $gedcom ??= $this->gedcom($xref, $tree);
48 … if ($gedcom === null && ($pending === null || !preg_match(self::TYPE_CHECK_REGEX, $pending))) {
52 $xref = $this->extractXref($gedcom ?? $pending, $xref);
54 return $this->new($xref, $gedcom ?? '', $pending, $tree);
79 * @param string $gedcom an empty string for new/pending records
86 public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Repository argument
88 return new Repository($xref, $gedcom, $pending, $tree);
99 protected function gedcom(string $xref, Tree $tree): string|null function in Fisharebest\\Webtrees\\Factories\\RepositoryFactory
/webtrees/app/
H A DGedcomRecord.php78 protected string $gedcom; variable in Fisharebest\\Webtrees\\GedcomRecord
99 * @param string $gedcom an empty string for new/pending records
104 public function __construct(string $xref, string $gedcom, string|null $pending, Tree $tree) argument
107 $this->gedcom = $gedcom;
166 preg_match('/^0 @[^@]*@ (\w+)/', $this->gedcom(), $match);
197 public function gedcom(): string function in Fisharebest\\Webtrees\\GedcomRecord
199 return $this->pending ?? $this->gedcom;
297 return $this->gedcom;
307 [$gedcom] = explode("\n", $this->gedcom . $this->pending, 2);
311 $gedcom .= "\n" . $fact->gedcom();
[all …]
H A DTree.php352 * @param string $gedcom
357 public function createRecord(string $gedcom): GedcomRecord argument
359 if (preg_match('/^0 @@ ([_A-Z]+)/', $gedcom, $match) !== 1) {
360 …throw new InvalidArgumentException('GedcomRecord::createRecord(' . $gedcom . ') does not begin 0 @…
364 $gedcom = substr_replace($gedcom, $xref, 3, 0);
369 …$gedcom .= "\n1 CHAN\n2 DATE " . $today . "\n3 TIME " . $now . "\n2 _WT_USER " . Auth::user()->use…
376 'new_gedcom' => $gedcom,
383 $record = Registry::gedcomRecordFactory()->new($xref, $gedcom, null, $this);
391 return Registry::gedcomRecordFactory()->new($xref, '', $gedcom, $this);
397 * @param string $gedcom
[all …]
/webtrees/app/Services/
H A DGedcomImportService.php450 * @param string $gedcom
452 private function importLegacyPlacDefn(string $gedcom): void argument
456 if (preg_match('/\n1 PLAC (.+)/', $gedcom, $match)) {
462 if (preg_match('/\n3 LATI ([NS].+)/', $gedcom, $match)) {
468 if (preg_match('/\n3 LONG ([EW].+)/', $gedcom, $match)) {
489 * @param string $gedcom
491 private function importTNGPlac(string $gedcom): void argument
493 if (preg_match('/^0 _PLAC (.+)/', $gedcom, $match)) {
499 if (preg_match('/\n2 LATI (.+)/', $gedcom, $match)) {
505 if (preg_match('/\n2 LONG (.+)/', $gedcom, $match)) {
[all …]
H A DGedcomExportService.php229 $gedcom = $datum;
231 $gedcom = $datum->privatizeGedcom($access_level);
233 if ($gedcom === '') {
237 $gedcom =
245 …& $zip_filesystem !== null && preg_match('/0 @' . Gedcom::REGEX_XREF . '@ OBJE/', $gedcom) === 1) {
246 preg_match_all('/\n1 FILE (.+)/', $gedcom, $matches, PREG_SET_ORDER);
257 $gedcom = $this->wrapLongLines($gedcom, Gedcom::LINE_LENGTH) . "\n";
260 $gedcom = strtr($gedcom, ["\n" => "\r\n"]);
263 $bytes_written = fwrite($stream, $gedcom);
265 if ($bytes_written !== strlen($gedcom)) {
[all …]
H A DGedcomEditService.php93 …me_facts = Collection::make($names)->map(static fn (string $gedcom): Fact => new Fact($gedcom, $du…
108 $gedcom = trim('1 ' . $tag . ' ' . $default);
110 return new Fact($gedcom, $record, '');
178 $gedcom = implode("\n", $gedcom_lines);
180 if ($append && $gedcom !== '') {
181 $gedcom = "\n" . $gedcom;
184 return $gedcom;
198 $gedcom = preg_replace('/\n\d CONT ?/', "\r", $fact->gedcom());
200 …return $this->insertMissingLevels($fact->record()->tree(), $fact->tag(), $gedcom, $include_hidden);
214 $gedcom = preg_replace('/\n\d CONT ?/', "\r", $record->gedcom());
[all …]
/webtrees/app/Http/RequestHandlers/
H A DEditRawRecordAction.php61 $gedcom = explode("\n", $record->gedcom(), 2)[0];
64 $gedcom = '0 HEAD';
67 $gedcom = '0 @' . $xref . '@ ' . $record->tag();
71 $gedcom = $level0;
77 $gedcom .= "\n" . $fact->gedcom();
82 $gedcom .= "\n" . trim($fact);
86 $gedcom = preg_replace('/[\r\n]+/', "\n", $gedcom);
87 $gedcom = trim($gedcom);
89 $record->updateRecord($gedcom, false);
H A DMergeFactsAction.php107 $gedcom = str_replace('@' . $xref2 . '@', '@' . $xref1 . '@', $record->gedcom());
108 $gedcom = preg_replace(
111 $gedcom
113 $record->updateRecord($gedcom, true);
150 $gedcom = '0 @' . $record1->xref() . '@ ' . $record1->tag();
154 $gedcom .= "\n" . $fact->gedcom();
160 $gedcom .= "\n" . $fact->gedcom();
169 $record1->updateRecord($gedcom, true);
H A DCreateSourceAction.php60 $gedcom = "0 @@ SOUR\n1 TITL " . strtr($title, ["\n" => "\n2 CONT "]);
63 $gedcom .= "\n1 ABBR " . strtr($abbreviation, ["\n" => "\n2 CONT "]);
67 $gedcom .= "\n1 AUTH " . strtr($author, ["\n" => "\n2 CONT "]);
71 $gedcom .= "\n1 PUBL " . strtr($publication, ["\n" => "\n2 CONT "]);
75 $gedcom .= "\n1 TEXT " . strtr($text, ["\n" => "\n2 CONT "]);
79 $gedcom .= "\n1 REPO @" . $repository . '@';
82 $gedcom .= "\n2 CALN " . strtr($call_number, ["\n" => "\n3 CONT "]);
87 $gedcom .= "\n1 RESN " . strtr($restriction, ["\n" => "\n2 CONT "]);
90 $record = $tree->createRecord($gedcom);
H A DCheckTree.php79 private Gedcom $gedcom; variable in Fisharebest\\Webtrees\\Http\\RequestHandlers\\CheckTree
84 * @param Gedcom $gedcom
87 public function __construct(Gedcom $gedcom, TimeoutService $timeout_service) argument
89 $this->gedcom = $gedcom;
138 if ($row->type === '' && str_starts_with($row->gedcom, '0 HEAD')) {
142 … if ($row->type === '' && preg_match('/^0 @[^@]*@ ([_A-Z0-9]+)/', $row->gedcom, $match) === 1) {
153 if ($row->gedcom !== '') {
171 $this->gedcom->registerTags($element_factory, false);
184 $lines = explode("\n", $record->gedcom);
257 …ag === 'FAM:HUSB' || $full_tag === 'FAM:WIFE') && !str_contains($linked->gedcom, "\n1 FAMS @" . $r…
[all …]
/webtrees/app/Module/
H A DFixDuplicateLinks.php187 $gedcom = $record->gedcom();
190 preg_match('/(\n1.*@.+@.*(?:\n[2-9].*)*)(?:\n1.*(?:\n[2-9].*)*)*\1/', $gedcom) ||
191 preg_match('/(\n2.*@.+@.*(?:\n[3-9].*)*)(?:\n2.*(?:\n[3-9].*)*)*\1/', $gedcom) ||
192 preg_match('/(\n3.*@.+@.*(?:\n[4-9].*)*)(?:\n3.*(?:\n[4-9].*)*)*\1/', $gedcom);
205 $old = $record->gedcom();
231 $gedcom = $record->gedcom();
232 …$gedcom = preg_replace('/(\n1.*@.+@.*(?:\n[2-9].*)*)((?:\n1.*(?:\n[2-9].*)*)*\1)/', '$2', $gedcom);
233 …$gedcom = preg_replace('/(\n2.*@.+@.*(?:\n[3-9].*)*)((?:\n2.*(?:\n[3-9].*)*)*\1)/', '$2', $gedcom);
235 … return preg_replace('/(\n3.*@.+@.*(?:\n[4-9].*)*)((?:\n3.*(?:\n[4-9].*)*)*\1)/', '$2', $gedcom);
H A DFixCemeteryTag.php120 … ->filter(static fn (Fact $fact): bool => preg_match('/\n[23] CEME/', $fact->gedcom()) === 1)
138 $old[] = $fact->gedcom();
171 $gedcom = $fact->gedcom();
173 if (preg_match('/\n\d CEME ?(.+)(?:\n\d PLOT ?(.+))?/', $gedcom, $match)) {
183 $gedcom = strtr($gedcom, [$match[0] => '']);
188 if (!str_contains($gedcom, "\n2 " . $convert . ' ')) {
189 $gedcom .= "\n2 " . $convert . ' ' . $ceme;
191 … $gedcom = strtr($gedcom, ["\n2 " . $convert . ' ' => "\n2 " . $convert . ' ' . $ceme . ', ']);
195 return $gedcom;
H A DFixNameSlashesAndSpaces.php91 $gedcom = $record->gedcom();
94 … preg_match('/^(?:1 NAME|2 (?:FONE|ROMN|_MARNM|_AKA|_HEB)) [^\/\n]*\/[^\/\n]*$/m', $gedcom) ||
95 preg_match('/^(?:1 NAME|2 (?:FONE|ROMN|_MARNM|_AKA|_HEB)) [^\/\n]*[^\/ ]\//m', $gedcom);
108 $old = $record->gedcom();
134 $gedcom = $record->gedcom();
135 …$gedcom = preg_replace('/^((?:1 NAME|2 (?:FONE|ROMN|_MARNM|_AKA|_HEB)) [^\/\n]*\/[^\/\n]*)$/m', '$…
137 …_replace('/^((?:1 NAME|2 (?:FONE|ROMN|_MARNM|_AKA|_HEB)) [^\/\n]*[^\/ ])(\/)/m', '$1 $2', $gedcom);
H A DFixNameTags.php122 … return preg_match('/\n1 NAME.*(?:\n[2-9] .*)*\n2 (' . $tags . ')/', $record->gedcom()) === 1;
138 $old = $name->gedcom();
162 $old = $name->gedcom();
178 $gedcom = $fact->gedcom();
183 while (preg_match('/\n2 (' . $tags . ') (.+)((?:\n[3-9].*)*)/', $gedcom, $match)) {
188 $gedcom = str_replace($match[0], '', $gedcom);
199 return $gedcom . $converted;

123456789