liberu-genealogy / laravel-gedcom
一个将 gedcom 文件转换为 Eloquent 模型的包
v4.1.3
2024-06-10 11:06 UTC
Requires
- php: >=8.3
- liberu-genealogy/php-gedcom: ^2.0
Requires (Dev)
- driftingly/rector-laravel: ^1.2.0
- laravel/framework: ^11.0
- phpunit/phpunit: ^10.0||^11.0||^12.0
- rector/rector: ^1.0.0
- dev-main
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.0
- v3.4.16
- v3.4.15
- v3.4.14
- v3.4.13
- v3.4.12
- v3.4.11
- v3.4.10
- v3.4.9
- v3.4.8
- v3.4.7
- v3.4.6
- v3.4.5
- v3.4.4
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.1
- v3.3.0
- v3.2.12
- v3.2.11
- v3.2.10
- v3.2.9
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.11
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.3.21
- v2.3.20
- v2.3.19
- v2.3.18
- v2.3.17
- v2.3.16
- v2.3.15
- v2.3.14
- v2.3.13
- v2.3.12
- v2.3.11
- v2.3.10
- v2.3.9
- v2.3.8
- v2.3.7
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.4
- v1.1.3
- v1.1.0
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.2
- v1.0.1
- v1.0.0
- dev-sweep/Improve-GedcomParser-registration-and-add-GedcomImporter-command
- dev-sweep/Add-unit-test-for-GEDCOM-export-error-handling
- dev-sweep/Upgrade-PHPUnit-to-use-TestCase-instead-of-PHPUnit-Framework-TestCase
- dev-sweep/Improve-GedcomExporterTest-unit-test
- dev-sweep/improve_codebase_for_modularization_and
- dev-sweep/add-tests-for-gedcom-exporter-helpers
- dev-sweep/add-function-docstrings
- dev-sweep/laravel_11
- dev-sweep/refactor-test-functions
- dev-sweep/refactor-gedcom-exporter
- dev-sweep/write_full_tests_a0726
- dev-sweep/write_full_tests
- dev-sweep/add-unit-tests-for-gedcom-classes
- dev-sweep/refactor-functions
- dev-sweep/refactor_codebase_to_use_php_83_and_lara
- dev-bugfix/psr-4-warnings
- dev-master
This package is auto-updated.
Last update: 2024-08-28 22:42:28 UTC
README
liberu-genealogy/laravel-gedcom 是一个用于解析 GEDCOM 文件并将其作为 Laravel 模型导入到您的 Laravel 应用程序中的包。它被以下项目使用:(https://github.com/liberu-genealogy/genealogy-laravel)
安装
composer require liberu-genealogy/laravel-gedcom
使用
在进行任何操作之前,您必须创建数据库模式,因此请运行迁移
php artisan migrate
通过命令行
php artisan gedcom:import /path/to/your/gedcom/file.ged
通过外观
use FamilyTree365\LaravelGedcom\Facades\GedcomParserFacade;
$filename = '/path/to/your/gedcom/file.ged';
GedcomParserFacade::parse($filename, true);
通过实例化
use \FamilyTree365\LaravelGedcom\Utils\GedcomParser;
$filename = '/path/to/your/gedcom/file.ged';
$parser = new GedcomParser();
$parser->parse($filename, true);
文档
数据库
此包将创建数据库表,这些表映射到模型。
parse()
方法
parse()
方法接受三个参数,string $filename
、bool $progressBar = false
和 string $conn
。如果您将 $progressBar
设置为 true,则将在 php://stdout
输出进度条,这对于您从 Artisan 命令调用解析器非常有用。
贡献
欢迎拉取请求和问题。
贡献者
许可证
MIT 许可证(见 License.md)。这意味着您必须在所有副本或此软件的大部分内容中保留版权和许可通知。