Laravel "new project"安装一堆应用程序



我是Laravel的新手。我使用Vagrant和虚拟机,因此我在那里安装了作曲家Aand Laravel安装程序。每次创建新项目时,我都会看到它还安装了许多其他应用程序。它说

制作应用程序...带包装的作曲家存储库 锁定的信息安装依赖关系(包括require-dev( 文件包操作:70个安装,0个更新,0删除

然后获取安装的应用列表

  - Installing doctrine/inflector (v1.3.0): Loading from cache
  - Installing doctrine/lexer (v1.0.1): Loading from cache
  - Installing dragonmantank/cron-expression (v2.0.0): Loading from cache
  - Installing erusev/parsedown (1.7.1): Loading from cache
  - Installing vlucas/phpdotenv (v2.4.0): Loading from cache
  - Installing symfony/css-selector (v4.0.6): Loading from cache
  - Installing tijsverkoyen/css-to-inline-styles (2.2.1): Loading from cache
  - Installing symfony/polyfill-php72 (v1.7.0): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.7.0): Loading from cache
  - Installing symfony/var-dumper (v4.0.6): Loading from cache
  - Installing symfony/routing (v4.0.6): Loading from cache
  - Installing symfony/process (v4.0.6): Loading from cache
  - Installing symfony/http-foundation (v4.0.6): Loading from cache
  - Installing symfony/event-dispatcher (v4.0.6): Loading from cache
  - Installing psr/log (1.0.2): Loading from cache
  - Installing symfony/debug (v4.0.6): Loading from cache
  - Installing symfony/http-kernel (v4.0.6): Loading from cache
  - Installing symfony/finder (v4.0.6): Loading from cache
  - Installing symfony/console (v4.0.6): Loading from cache
  - Installing egulias/email-validator (2.1.3): Loading from cache
  - Installing swiftmailer/swiftmailer (v6.0.2): Loading from cache
  - Installing paragonie/random_compat (v2.0.11): Loading from cache
  - Installing ramsey/uuid (3.7.3): Loading from cache
  - Installing psr/simple-cache (1.0.1): Loading from cache
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/translation (v4.0.6): Loading from cache
  - Installing nesbot/carbon (1.25.0): Loading from cache
  - Installing monolog/monolog (1.23.0): Loading from cache
  - Installing league/flysystem (1.0.43): Loading from cache
  - Installing laravel/framework (v5.6.14): Downloading (100%)
  - Installing fideloper/proxy (4.0.0): Loading from cache
  - Installing jakub-onderka/php-console-color (0.1): Loading from cache
  - Installing nikic/php-parser (v3.1.5): Loading from cache

和等可以,还是我做错了什么?我使用命令

laravel new exampleproject

您没有做错任何事情,这是安装Laravel项目依赖项时的预期行为。

事物是作曲家不仅安装了该项目composer.json中列出的依赖项,还安装了依赖关系的依赖项,等等。

例如,Laravel应用程序composer文件需要以下依赖项:

"require": {
    "php": "^7.1.3",
    "fideloper/proxy": "^4.0",
    "laravel/framework": "5.6.*",
    "laravel/tinker": "^1.0"
}

,但作曲家必须确保您还具有运行这些运行所需的所有依赖性,因此它在其各自的composer.json文件中看起来像laravel/framework中的CC_3文件,其中包含以下内容:

"require": {
    "php": "^7.1.3",
    "ext-mbstring": "*",
    "ext-openssl": "*",
    "doctrine/inflector": "~1.1",
    "dragonmantank/cron-expression": "~2.0",
    "erusev/parsedown": "~1.7",
    "league/flysystem": "^1.0.8",
    "monolog/monolog": "~1.12",
    "nesbot/carbon": "^1.24.1",
    "psr/container": "~1.0",
    "psr/simple-cache": "^1.0",
    "ramsey/uuid": "^3.7",
    "swiftmailer/swiftmailer": "~6.0",
    "symfony/console": "~4.0",
    "symfony/debug": "~4.0",
    "symfony/finder": "~4.0",
    "symfony/http-foundation": "~4.0",
    "symfony/http-kernel": "~4.0",
    "symfony/process": "~4.0",
    "symfony/routing": "~4.0",
    "symfony/var-dumper": "~4.0",
    "tijsverkoyen/css-to-inline-styles": "^2.2.1",
    "vlucas/phpdotenv": "~2.2"
}

它将它们安装,依此类推,直到达到每一个依赖性为止。

您可以想象,这可能会很快加起来,并且在您的项目中安装了一个依赖性,如果您想检查它们。

这就是为什么您安装的依赖项比预期的要多。

最新更新