首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Composer提取托管在Github Enterprise上的Wordpress插件

使用Composer提取托管在Github Enterprise上的Wordpress插件
EN

Stack Overflow用户
提问于 2015-05-20 10:12:35
回答 1查看 205关注 0票数 1

我正在尝试添加一个来自Github企业存储库的Wordpress插件到我的项目中。我的wp-content文件夹位于根目录中,我的composer.json如下所示:

代码语言:javascript
复制
  "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/文件夹中。

我得到以下错误:

代码语言:javascript
复制
    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"”这样的面向公众的代码库,它会正确地下载到插件名称文件夹中。

有没有什么东西可以让github企业托管的wordpress插件能够被解压到wp-content文件夹中?

EN

回答 1

Stack Overflow用户

发布于 2015-05-21 09:12:14

有效的公共URL是该存储库的发行版。参见4.2.2版本中的链接“源代码(zip)”-它与您所指向的公共.zip URL相匹配:

https://github.com/WordPress/WordPress/releases/tag/4.2.2

类似地,如果您获取您已有的源代码并“释放”它,那么您不是将.zip存储在repo中,而是使它成为一个发行版,并引用它应该起作用的release .zip。

或者,如果您将.zip放在存储库中,如果您引用“原始”url,那么它可能会起作用,但上面的示例实际上重新创建了公共场景。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30339153

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档