我正在尝试将来自 Github Enterprise 存储库的 Wordpress 插件添加到我的项目中。我在根目录中有我的 wp-content 文件夹,我的 composer.json 如下:
"repositories": [
{
"type": "package",
"package": {
"name": "name/plugin-name,
"type": "wordpress-plugin",
"version": "v1.0",
"dist": {
"type": "zip",
"url": "https://example.githubname.com/name/plugin-name/archive/v1.0.zip"
},
"require" : {
"composer/installers": "v1.0.21"
}
}
},
{
"type":"composer",
"url":"http://wpackagist.org"
}
],
"require": {
"name/plugin-name": "v1.0"
},
}
以下存储库将解压缩此存储库并将其解压缩到 /wp-content/ 文件夹中。
我收到以下错误:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing name/plugin-name (v1.0)
Downloading: 100%
Invalid zip file, retrying...
- Installing name/plugin-name (v1.0)
Downloading: 100%
Invalid zip file, retrying...
- Installing name/plugin-name (v1.0)
Downloading: 100%
[UnexpectedValueException]
'wp-content/plugins/plugin-name//2b5746433a46375b233f5f91a9a69b43.zip' is not a zip archive.
看起来 zip 可能正在尝试通过 Github Enterprise 进行身份验证。我尝试删除 ""url": " https://example.githubname.com/name/plugin-name/archive/v1.0.zip "" 并添加一个面向公众的存储库,例如 ""url": " https:// /github.com/WordPress/WordPress/archive/4.2.2.zip "" 并正确下载到 plugin-name 文件夹中。
对于 github 企业托管的 wordpress 插件,我有什么办法可以提取到 wp-content 文件夹中吗?