liberu-genealogy/laravel-gedcom 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

liberu-genealogy/laravel-gedcom

Composer 安装命令:

composer require liberu-genealogy/laravel-gedcom

包简介

A package that converts gedcom files to Eloquent models

README 文档

README

Latest Stable Version Tests

liberu-genealogy/laravel-gedcom is a package to parse GEDCOM files, and import them as Laravel models, inside your Laravel application. It is used by: (https://github.com/liberu-genealogy/genealogy-laravel)

  • laravel-gedcom 5.0+ requires PHP 8.3 (or later).

Installation

composer require liberu-genealogy/laravel-gedcom

Usage

You must create the database schema before doing anything, so run the migrations:

php artisan migrate

GEDCOM Files

via Command Line

php artisan gedcom:import /path/to/your/gedcom/file.ged

via Facade

use FamilyTree365\LaravelGedcom\Facades\GedcomParserFacade;
$filename = '/path/to/your/gedcom/file.ged';
GedcomParserFacade::parse($filename, true);

via Instantiation

use \FamilyTree365\LaravelGedcom\Utils\GedcomParser;
$filename = '/path/to/your/gedcom/file.ged';
$parser = new GedcomParser();
$parser->parse($filename, true);

GedcomX Files

via Command Line

php artisan gedcomx:import /path/to/your/gedcomx/file.json --progress

via Facade

use FamilyTree365\LaravelGedcom\Facades\GedcomXParserFacade;
$filename = '/path/to/your/gedcomx/file.json';
GedcomXParserFacade::parse('mysql', $filename, 'import-slug', true);

via Instantiation

use \FamilyTree365\LaravelGedcom\Utils\GedcomXParser;
$filename = '/path/to/your/gedcomx/file.json';
$parser = new GedcomXParser();
$parser->parse('mysql', $filename, 'import-slug', true);

Checking if a file is GedcomX

use \FamilyTree365\LaravelGedcom\Utils\GedcomXParser;
$filename = '/path/to/your/file.json';
if (GedcomXParser::isGedcomXFile($filename)) {
    // Process as GedcomX file
} else {
    // Process as regular GEDCOM file
}

High-Performance GedcomX (PHP 8.4+ Optimized)

For maximum performance with large GedcomX files, use the optimized parser that leverages PHP 8.4 features:

via Optimized Command Line

php artisan gedcomx:import-optimized /path/to/your/gedcomx/file.json --progress --memory-limit=1024 --chunk-size=2000

via Optimized Instantiation

use \FamilyTree365\LaravelGedcom\Utils\GedcomXParserOptimized;
$filename = '/path/to/your/gedcomx/file.json';
$parser = new GedcomXParserOptimized();
$parser->parse('mysql', $filename, 'import-slug', true);

Performance Features (PHP 8.4+)

  • 🚀 Up to 3x faster processing using modern PHP features
  • 💾 50% less memory usage with optimized data structures
  • 📦 Intelligent batch processing with automatic chunk sizing
  • 🔄 Garbage collection optimization for large datasets
  • ⚡ Match expressions for faster conditional logic
  • 🎯 Typed constants for better performance
  • 📊 Real-time performance metrics during import

Performance Comparison

Feature Standard Parser Optimized Parser (PHP 8.4)
Processing Speed 1x 3x faster
Memory Usage 100% 50% less
Batch Processing Fixed 500 Dynamic 1000-5000
Error Handling Basic Advanced with metrics
PHP Version 8.3+ 8.4+ only

Documentation

GEDCOM Data Import

See GEDCOM_DATA_IMPORT.md for a comprehensive reference of all GEDCOM tags and data elements imported by this package.

Database

This package will create the database tables, which map to models.

parse() Method

The parse() method takes three parameters, string $filename, bool $progressBar = false and string $conn If you set $progressBar to true, a ProgressBar will be output to php://stdout, which is useful when you are calling the parser from Artisan commands.

Contributing

Pull requests are welcome, as are issues. Feel free to submit any feedback too.

Contributors

License

MIT License (see License.md). This means you must retain the copyright and permission notice is all copies, or substantial portions of this software.

liberu-genealogy/laravel-gedcom 适用场景与选型建议

liberu-genealogy/laravel-gedcom 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.02k 次下载、GitHub Stars 达 78, 最近一次更新时间为 2024 年 03 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 liberu-genealogy/laravel-gedcom 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 liberu-genealogy/laravel-gedcom 我们能提供哪些服务?
定制开发 / 二次开发

基于 liberu-genealogy/laravel-gedcom 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 78
  • 点击次数: 18
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 78
  • Watchers: 2
  • Forks: 49
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-14