Is it possible to ignore child dependencies in Composer config?

前端 未结 4 1346
独厮守ぢ
独厮守ぢ 2020-12-30 01:49

When I run composer install, it will install all my \"require\" and the \"require\" of the other package.

My composer.json

{
    \"name\": \"my_app\"         


        
4条回答
  •  余生分开走
    2020-12-30 02:25

    Another option could be to modify the composer.json of the child package and to remove the required dependencies. Then you could host the zip file and add reference it by adding an extra repository for your main package.

    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "dr-que/x-y",
                "version": "master",
                "dist": {
                    "type": "zip",
                    "url": "http://xyplot.drque.net/Downloads/XY_Plot-1.4.zip",
                    "reference": "master"
                },
                "autoload": {
                    "classmap": ["."]
                }
            }
        }
    ]
    

    Then in your require section, add your selected name as follows.

    "require": {
        "dr-que/x-y": "dev-master"
    }
    

    For the autoload, I just copied the same autoload section of the child package.

    The original solution can be found here

提交回复
热议问题