composer.lock文件如何用于安装依赖项?

时间:2018-09-26 05:43:51

标签: php composer-php composer.json

我有一个名为'evenement/evenement'的软件包,已安装并存储在我的composer.lock文件中。

{
        "name": "evenement/evenement",
        "version": "v3.0.1",
        "source": {
            "type": "git",
            "url": "https://github.com/igorw/evenement.git",
            "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7"
        },
        "dist": {
            "type": "zip",
            "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7",
            "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7",
            "shasum": ""
        },
        "require": {
            "php": ">=7.0"
        },
        "require-dev": {
            "phpunit/phpunit": "^6.0"
        },
    },

还有其他需要此软件包的软件包。

{
        "name": "react/socket",
        "version": "v1.0.0",
        "source": {
            "type": "git",
            "url": "https://github.com/reactphp/socket.git",
            "reference": "476e2644a634c6301b8111e6d22a61679e6e6bd0"
        },
        "dist": {
            "type": "zip",
            "url": "https://api.github.com/repos/reactphp/socket/zipball/476e2644a634c6301b8111e6d22a61679e6e6bd0",
            "reference": "476e2644a634c6301b8111e6d22a61679e6e6bd0",
            "shasum": ""
        },
        "require": {
            "evenement/evenement": "^3.0 || ^2.0 || ^1.0",
            "php": ">=5.3.0",
            "react/dns": "^0.4.13",
            "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5",
            "react/promise": "^2.6.0 || ^1.2.1",
            "react/promise-timer": "^1.4.0",
            "react/stream": "^1.0 || ^0.7.1"
        },
        "require-dev": {
            "clue/block-react": "^1.2",
            "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
        },
    },

所以我的问题是,如果我composer.install,那么是否会通过检查require软件包上的react/socket字段来安装'evenement'软件包?

或者将通过直接检查version程序包本身上的evenement/evenement字段来安装它。

我猜这些只是子依赖项,因为我没有明确安装它们,即我的composer.json文件中没有它们。

这是我的composer.json文件:

{


"name": "growbydata/gbdportal",
  "description": "Internal portal of GrowByData",
  "homepage": "http://192.168.11.32/gbd-portal",
  "license": "MIT",
  "autoload": {
        "psr-4": {
            "MyApp\\": "gbdportal/app/GBD/Internals/Controllers"
        }
    },
  "require": {
    "phpmailer/phpmailer": "5.2.9",
    "phpoffice/phpexcel": "1.8.0",
    "raveren/kint":"1.0.x-dev",
    "jaspersoft/rest-client": "dev-master",
    "cboden/ratchet": "dev-master",
    "react/zmq": "dev-master"
    },
  "minimum-stability": "dev"
}

我希望我把问题弄清楚。

0 个答案:

没有答案