如何在本地包含二阶依赖

时间:2019-06-13 07:59:01

标签: testing composer-php local

我同时在开发两个作曲家软件包:一个将在我开发的其他软件包中使用的常规软件包,以及一个用于特定目的的特定软件包,需要该常规软件包才能工作。

现在,我的目录如下:

projects
|- general-package
|  |- composer.json
|  |- "other files"
|
|- specific-package
|  |- composer.json
|  |- "other files"
|
|- testing-directory
   |- composer.json
   |- "other files"

这是3个composer.json文件:

general-package / composer.json

{
    "name": "vendor/general-package",
    "require": {
        "php": ">=7.0.0"
    }
}

specific-package / composer.json

{
    "name": "vendor/specific-package",
    "require": {
        "php": ">=7.0.0",
        "vendor/general-package": "^1.0"
    }
}

testing-directory / composer.json

{
    "config": {
        "preferred-install": "source"
    },
    "repositories": [{
            "type": "path",
            "url": "../specific-package",
            "options": {
                "symlink": true
            }
        },
        {
            "type": "path",
            "url": "../general-package",
            "options": {
                "symlink": true
            }
        },
    ],
    "require": {
        "php": ">=5.3.7",
        "vendor/specific-package": "@dev",
        "vendor/general-package": "@dev"
    }
}

在测试目录中运行composer update时,软件包vendor/specific-package是从本地来源获取的,而vendor/general-package是从packagist.org中获取的。

如何强制vendor/general-package也要在本地获取?

0 个答案:

没有答案