定制 magicsunday/webtrees-module-installer-plugin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

magicsunday/webtrees-module-installer-plugin

Composer 安装命令:

composer require magicsunday/webtrees-module-installer-plugin

包简介

Composer plugin for the webtrees genealogy application — auto-installs webtrees-module packages into the modules_v4 directory during composer install and update.

README 文档

README

Latest version License CI

A powerful Composer plugin that simplifies the installation of modules for the webtrees genealogy application by automatically placing them in the correct directory structure.

🚀 Seamless Integration

Automatically installs webtrees modules to the correct modules_v4 directory without manual file copying.

⚙️ Easy Configuration

Simple setup with minimal configuration required in your composer.json file.

🌟 Why Use This Plugin?

When developing or using modules for webtrees, managing the installation process can be cumbersome. This plugin solves that problem by:

  • Automatically detecting and installing packages of type webtrees-module and webtrees-theme
  • Placing modules and themes in the correct modules_v4 directory structure
  • Supporting both direct installation and installation via a separate composer.json
  • Eliminating the need for manual file copying or symlink creation

📋 Requirements

System Requirements

  • PHP 8.3 – 8.5
  • Composer 2.6 or higher

🔧 Installation

Add this plugin to the require or require-dev section of your composer.json file:

"require": {
    "magicsunday/webtrees-module-installer-plugin": "^2.0"
},

Or install it using Composer:

composer require magicsunday/webtrees-module-installer-plugin

Make sure to allow the plugin in your composer.json:

"config": {
    "allow-plugins": {
        "magicsunday/webtrees-module-installer-plugin": true
    }
}

📦 Usage

For Module Users

To install a webtrees module with composer, simply require the module in your composer.json:

composer require vendor-name/module-name

The plugin will automatically install the module to the modules_v4 directory.

For Module Developers

When creating a webtrees module, set the package type to webtrees-module in your module's composer.json:

{
    "name": "your-vendor-name/your-module-name",
    "description": "Your module description",
    "type": "webtrees-module",
    "require": {
        "php": "8.3 - 8.5",
        "magicsunday/webtrees-module-installer-plugin": "^2.0"
    }
}

Pro Tip

The module name in the composer.json file will determine the directory name in the modules_v4 directory.

Themes

Themes are installed exactly like modules. Since a webtrees theme is a module as well, set the package type to webtrees-theme and it will be placed in the same modules_v4 directory:

{
    "name": "your-vendor-name/your-theme-name",
    "description": "Your theme description",
    "type": "webtrees-theme",
    "require": {
        "php": "8.3 - 8.5",
        "magicsunday/webtrees-module-installer-plugin": "^2.0"
    }
}

Installing from GitHub

If your module is not listed on Packagist, you can install it directly from GitHub:

composer config repositories.your-repo-name vcs https://github.com/your-vendor-name/your-module-name
composer require your-vendor-name/your-module-name[:optional-branch-name]

For example, to install the dev-main branch:

composer require your-vendor-name/your-module-name:dev-main

🧪 Testing

The plugin includes several testing tools to ensure code quality:

# Run all tests
composer ci:test

# Run specific tests
composer ci:test:php:lint     # PHP linting
composer ci:test:php:phpstan  # Static analysis
composer ci:test:php:rector   # Code quality checks
composer ci:test:php:cgl      # Coding guidelines
composer ci:test:php:unit     # Unit tests (PHPUnit)

🔍 How It Works

The plugin works by:

  1. Registering a custom installer with Composer's installation manager
  2. Subscribing to package-level events (PRE_PACKAGE_* / POST_PACKAGE_*) to queue webtrees-module and webtrees-theme operations
  3. Determining the correct installation path in the modules_v4 directory, whether fisharebest/webtrees is installed as a dependency or as the root package
  4. Re-installing all webtrees-module and webtrees-theme packages when fisharebest/webtrees itself is updated, so the modules and themes survive the core upgrade

The main components are:

  • ModuleInstallerPlugin: Implements Composer's PluginInterface and wires up the event listeners
  • ModuleInstaller: Extends Composer's LibraryInstaller; resolves the install path and delegates the actual install/update/uninstall operation

👥 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please make sure your code follows the project's coding standards by running the tests before submitting.

📄 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

🙏 Acknowledgements

  • webtrees - The open source web genealogy application
  • Composer - Dependency Manager for PHP

magicsunday/webtrees-module-installer-plugin 适用场景与选型建议

magicsunday/webtrees-module-installer-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15.33k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 08 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「installer」 「module」 「composer-plugin」 「webtrees」 「webtrees-module」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

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

围绕 magicsunday/webtrees-module-installer-plugin 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 15.33k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 12
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2018-08-26