小编Phi*_*ook的帖子

为wordpress主题和插件创建令人满意的作曲家私人存储库

我的目标是将一个composer.json文件提交到我们的项目存储库,该文件指定应该为该项目使用哪些主题或插件,当开发人员下载回购时,他们需要做的就是运行composer install.我们希望将插件保留在项目仓库之外,以阻止项目仓库的膨胀,并且拉动和推动变得缓慢.

对于标准的wordpress插件,例如"Jetpack by WordPress.com",这很好,因为我们将使用https://wpackagist.org/.但是,对于支付插件和内部定制的Premium而无法开源的我们希望将它们托管在Private Composer Repository中.

因为我们将有这些插件的多个版本,我希望所有版本都能显示,如1.1,1.2,1.3,因此开发人员可以在composer.json中指定哪个版本是必需的,例如,如果未来的版本破坏了某些东西,我们需要回滚到以前的版本.

我已经阅读了设置Satis私有存储库的基础知识,我已经这样做但是我不能让它循环遍历版本的git标签,并指定它是一个Wordpress插件并将其安装在正确的位置.

这是我第一次获得所有git标记版本的尝试:

{
    "name": "Private Repository",
    "homepage": "http://packages.privaterepo.com",
    "repositories": [
        {
            "type": "vcs",
            "url": "git@bitbucket.org:companyname/project.git"
        }
    ],
    "require-all": true
}
Run Code Online (Sandbox Code Playgroud)

这是我必须指定版本,但让它安装在正确的Wordpress插件位置:

{
    "name": "Private Repository",
    "homepage": "http://packages.privaterepo.com",
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "company/project",
                "description": "WordPress Plugin",
                "version": "1.0",
                "source": {
                    "type": "git",
                    "url": "git@bitbucket.org:company/project.git",
                    "reference": "origin/master"
                },
                "type": "wordpress-plugin",
                "require": {
                    "php": ">=5.3.2",
                    "composer/installers": "*"
                }
            }
        }
    ],
    "require-all": true,
    "require-dependencies": true,
    "extra": { …
Run Code Online (Sandbox Code Playgroud)

php git wordpress composer-php satis

7
推荐指数
1
解决办法
635
查看次数

标签 统计

composer-php ×1

git ×1

php ×1

satis ×1

wordpress ×1