convertiv/composer-wordpress
Composer 安装命令:
composer require convertiv/composer-wordpress
包简介
This library fills a gap when using wordpress with composer. Previously, packages like Drupal's preserve paths composer plugin closed this gap, but with Composer 2's parallel operations, preserve paths creates a race condition.
README 文档
README
This is a Composer plugin that copies packages (in our case WordPress plugins, mu-plugins and themes) from a specified source path to a specified destination path, as defined in the composer.json file.
Installation
You can install this plugin by doing the following:
1. Setup in the composer.json file of your project
Add the following configuration to your composer.json file:
{
"extra": {
"wordpress-install-dir": "public/",
"composer-custom-install-path-src": "bin/composer_wordpress_vendor/wp-content",
"composer-custom-install-path-dest": "public/wp-content",
"installer-paths": {
"bin/composer_wordpress_vendor/wp-content/plugins/{$name}/": [
"type:wordpress-plugin"
],
"bin/composer_wordpress_vendor/wp-content/mu-plugins/{$name}/": [
"type:wordpress-muplugin"
],
"bin/composer_wordpress_vendor/wp-content/themes/{$name}/": [
"type:wordpress-theme"
]
}
}
}
The wordpress-install-dir key defines the path to the WordPress installation directory which is installed using John Bloch's WordPress package.
the installer-paths key defines the paths to the WordPress packages to be copied. We're copying the WordPress packages to the bin/composer_wordpress_vendor/wp-content directory.
The composer-custom-install-path-src key defines the path to the source directory containing WordPress packages to be copied, and the composer-custom-install-path-dest key defines the path to the destination directory where the packages will be copied.
The plugin will automatically run during the post-install-cmd and post-update-cmd events, and will copy the WordPress packages from the source path to the destination path.
2. Run the following command to install the plugin:
composer require convertiv/composer-wordpress
Composer installer will ask whether you trust the plugin:
Do you trust "convertiv/composer-wordpress" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?]
Type y to allow the plugin to be used.
After this setup is done, the plugin will be used to copy WordPress packages from the source path to the destination path during composer install and composer update.
4. Add the folder path used in composer-custom-install-path-src to your .gitignore file
If you used bin/composer_wordpress_vendor/wp-content as the path, add the following to your .gitignore file:
bin/composer_wordpress_vendor
License This plugin is licensed under the MIT License. For more information, see the LICENCE file.
convertiv/composer-wordpress 适用场景与选型建议
convertiv/composer-wordpress 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.14k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 convertiv/composer-wordpress 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 convertiv/composer-wordpress 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-18