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
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-moduleandwebtrees-theme - Placing modules and themes in the correct
modules_v4directory 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:
- Registering a custom installer with Composer's installation manager
- Subscribing to package-level events (
PRE_PACKAGE_*/POST_PACKAGE_*) to queuewebtrees-moduleandwebtrees-themeoperations - Determining the correct installation path in the
modules_v4directory, whetherfisharebest/webtreesis installed as a dependency or as the root package - Re-installing all
webtrees-moduleandwebtrees-themepackages whenfisharebest/webtreesitself is updated, so the modules and themes survive the core upgrade
The main components are:
ModuleInstallerPlugin: Implements Composer'sPluginInterfaceand wires up the event listenersModuleInstaller: Extends Composer'sLibraryInstaller; resolves the install path and delegates the actual install/update/uninstall operation
👥 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 magicsunday/webtrees-module-installer-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Installs Aura packages to the Aura system "package" directory.
Composer plugin for preserving custom paths and supporting nested packages
Composer plugin
Install WordPress must-use plugins with Composer
Composer plugin that automatically creates directories defined in your composer.json.
Arikam CMS installers
统计信息
- 总下载量: 15.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-08-26