{"id":14975119,"url":"https://github.com/liberu-genealogy/php-gedcom","last_synced_at":"2026-02-15T08:21:45.364Z","repository":{"id":165323623,"uuid":"640654369","full_name":"liberu-genealogy/php-gedcom","owner":"liberu-genealogy","description":"Gedcom reading and writing for PHP 8.4","archived":false,"fork":false,"pushed_at":"2025-05-10T20:06:15.000Z","size":1249,"stargazers_count":76,"open_issues_count":0,"forks_count":41,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-10T21:19:17.666Z","etag":null,"topics":["gedcom","gedcom-parser","gedcom-parsing","laravel","laravel10","php","php8"],"latest_commit_sha":null,"homepage":"https://www.liberu.co.uk","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liberu-genealogy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"liberu-genealogy"}},"created_at":"2023-05-14T19:46:15.000Z","updated_at":"2025-05-10T20:06:19.000Z","dependencies_parsed_at":"2024-08-18T10:30:24.996Z","dependency_job_id":"d1e2da66-6aa2-4a41-acc3-41d66e6952d5","html_url":"https://github.com/liberu-genealogy/php-gedcom","commit_stats":{"total_commits":334,"total_committers":24,"mean_commits":"13.916666666666666","dds":0.7365269461077844,"last_synced_commit":"2acf76f45919fb2aa336eada65847b2f7a791eba"},"previous_names":["liberu-genealogy/php-gedcom"],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liberu-genealogy%2Fphp-gedcom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liberu-genealogy%2Fphp-gedcom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liberu-genealogy%2Fphp-gedcom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liberu-genealogy%2Fphp-gedcom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liberu-genealogy","download_url":"https://codeload.github.com/liberu-genealogy/php-gedcom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544146,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gedcom","gedcom-parser","gedcom-parsing","laravel","laravel10","php","php8"],"created_at":"2024-09-24T13:51:32.482Z","updated_at":"2026-02-15T08:21:45.355Z","avatar_url":"https://github.com/liberu-genealogy.png","language":"PHP","funding_links":["https://github.com/sponsors/liberu-genealogy"],"categories":[],"sub_categories":[],"readme":"# php-gedcom\n ![Latest Stable Version](https://img.shields.io/github/release/liberu-genealogy/php-gedcom.svg)\n[![Tests](https://github.com/liberu-genealogy/php-gedcom/actions/workflows/run-tests.yml/badge.svg)](https://github.com/liberu-genealogy/php-gedcom/actions/workflows/run-tests.yml)\n\n\n\n\n## Requirements\n\n* php-gedcom 2.0+ requires PHP 8.3 (or later). GEDCOM 5.5.1 only\n* php-gedcom 3.0+ requires PHP 8.4 (or later). GEDCOM 5.5.1 only\n* php-gedcom 4.0+ requires PHP 8.4 (or later). GEDCOM 5.5.1 and GEDCOM X with performance optimizations\n\n## Installation\n\nThere are two ways of installing php-gedcom.\n\n### Composer\n\nTo install php-gedcom in your project using composer, simply add the following require line to your project's `composer.json` file:\n\n    {\n        \"require\": {\n            \"liberu-genealogy/php-gedcom\": \"2.0.*\"\n        }\n    }\n\n### Download and __autoload\n\nIf you are not using composer, you can download an archive of the source from GitHub and extract it into your project. You'll need to setup an autoloader for the files, unless you go through the painstaking process if requiring all the needed files one-by-one. Something like the following should suffice:\n\n```php\nspl_autoload_register(function ($class) {\n    $pathToGedcom = __DIR__ . '/library/'; // TODO FIXME\n\n    if (!substr(ltrim($class, '\\\\'), 0, 7) == 'Gedcom\\\\') {\n        return;\n    }\n\n    $class = str_replace('\\\\', DIRECTORY_SEPARATOR, $class) . '.php';\n    if (file_exists($pathToGedcom . $class)) {\n        require_once($pathToGedcom . $class);\n    }\n});\n```\n\n## Performance Optimizations (PHP 8.4+)\n\nphp-gedcom 4.0+ includes significant performance improvements leveraging PHP 8.4 features:\n\n### Key Optimizations\n\n- **Streaming Parsers**: Automatic streaming for large files (\u003e100MB) to reduce memory usage\n- **Intelligent Caching**: LRU cache with file modification tracking and automatic invalidation\n- **Property Hooks**: Lazy initialization of parsers and generators using PHP 8.4 property hooks\n- **Optimized JSON Processing**: Enhanced JSON parsing with streaming support for large Gedcom X files\n- **Memory Efficiency**: Reduced memory footprint through optimized data structures\n\n### Performance Features\n\n- **Caching System**: Automatic caching of parsed files with configurable TTL and size limits\n- **Large File Support**: Streaming parsers handle files of any size without memory exhaustion\n- **Format Detection**: Fast file format detection with content analysis\n- **Batch Operations**: Optimized array operations using PHP 8.4 features\n\n### Benchmarking\n\nRun performance benchmarks to measure improvements:\n\n```bash\n# Basic benchmark\nphp examples/cli/performance-benchmark.php sample.ged\n\n# Full benchmark with streaming and report\nphp examples/cli/performance-benchmark.php large.ged --streaming --report\n\n# Save baseline for comparison\nphp examples/cli/performance-benchmark.php test.ged --baseline\n\n# Compare with baseline\nphp examples/cli/performance-benchmark.php test.ged --compare\n```\n\n### Cache Configuration\n\n```php\nuse Gedcom\\GedcomResource;\n\n// Enable caching with custom configuration\n$resource = new GedcomResource(\n    cacheEnabled: true,\n    cacheConfig: [\n        'memory_items' =\u003e 2000,           // Max items in memory cache\n        'cache_dir' =\u003e '/tmp/gedcom',     // Cache directory\n        'ttl' =\u003e 7200                     // Cache TTL in seconds\n    ]\n);\n\n// Get cache statistics\n$stats = $resource-\u003egetCacheStats();\necho \"Memory items: \" . $stats['memory_items'] . \"\\n\";\n\n// Clear cache when needed\n$resource-\u003eclearCache();\n```\n\n### Usage\n\nTo parse a GEDCOM file and load it into a collection of PHP Objects, simply instantiate a new Parser object and pass it the file name to parse. The resulting Gedcom object will contain all the information stored within the supplied GEDCOM file:\n\n```php\n$parser = new \\Gedcom\\Parser();\n$gedcom = $parser-\u003eparse('tmp.ged');\n\nforeach ($gedcom-\u003egetIndi() as $individual) {\n    $names = $individual-\u003egetName();\n    if (!empty($names)) {\n        $name = reset($names); // Get the first name object from the array\n        echo $individual-\u003egetId() . ': ' . $name-\u003egetSurn() . ', ' . $name-\u003egetGivn() . PHP_EOL;\n    }\n}\n```\n## Contributing \n\nPull requests are welcome, as are issues.\n\n\n## License\n\nMIT License (see License.md). This means you must retain the copyright and permission notice is all copies, or substantial portions of this software. \n\n## Contributors\n\n\u003ca href = \"https://github.com/liberu-genealogy/php-gedcom/graphs/contributors\"\u003e\n  \u003cimg src = \"https://contrib.rocks/image?repo=liberu-genealogy/php-gedcom\"/\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliberu-genealogy%2Fphp-gedcom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliberu-genealogy%2Fphp-gedcom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliberu-genealogy%2Fphp-gedcom/lists"}