Laravel“新项目”安装了一堆应用程序

时间:2018-03-28 17:21:44

标签: php laravel vagrant

我对Laravel来说是全新的。 我使用Vagrant和虚拟机,所以我在那里安装了composer a和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

1 个答案:

答案 0 :(得分:0)

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

事情是composer不仅安装了该项目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文件,其中包含以下内容:

"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"
}

它安装它们等等,直到它完成了每一个依赖。

正如您可以想象的那样,这可以快速增加,一旦安装,项目中的每个依赖项都会列在composer.lock文件中,如果您想要检查它们。

这就是为什么你安装了比你想象的更多的依赖项。