Laravel套餐:发现决心

时间:2017-12-21 21:55:13

标签: php laravel symfony composer-php

如何从我的项目层中解析发现包?

composer update

使用包信息加载composer存储库 更新依赖项(包括require-dev) 无需安装或更新 生成优化的自动加载文件 Illuminate\Foundation\ComposerScripts::postAutoloadDump

@php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: gloudemans/shoppingcart
Discovered Package: htmlmin/htmlmin
Discovered Package: mews/purifier
Discovered Package: rap2hpoutre/laravel-log-viewer
Discovered Package: roumen/sitemap
Discovered Package: laravel/socialite
Discovered Package: spatie/laravel-image-optimizer
Discovered Package: aloha/twilio
Discovered Package: laravel/tinker
Discovered Package: socialiteproviders/manager
Discovered Package: davejamesmiller/laravel-breadcrumbs
Package manifest generated successfully.

Composer.json:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=7.0.0",
    "aloha/twilio": "^3.0",
    "davejamesmiller/laravel-breadcrumbs": "^4.2",
    "fideloper/proxy": "^3.3",
    "gloudemans/shoppingcart": "^2.4",
    "golonka/bbcodeparser": "^2.2",
    "htmlmin/htmlmin": "^5.0",
    "kim/activity": "^1.1",
    "laravel/framework": "5.5.*",
    "laravel/socialite": "^3.0",
    "laravel/tinker": "~1.0",
    "mews/purifier": "^2.0",
    "rap2hpoutre/laravel-log-viewer": "^0.11.0",
    "roumen/sitemap": "^2.7",
    "socialiteproviders/vkontakte": "^3.0",
    "spatie/laravel-image-optimizer": "^1.1"
},
"require-dev": {
    "filp/whoops": "~2.0",
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~6.0"
},
"autoload": {
    "classmap": [
        "database/seeds",
        "database/factories"
    ],
    "psr-4": {
        "App\\": "app/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"extra": {
    "laravel": {
        "dont-discover": [
        ]
    }
},
"scripts": {
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate"
    ],
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover"
    ]
},
"config": {
    "preferred-install": "dist",
    "sort-packages": true,
    "optimize-autoloader": true
}}

如何解决这个问题?我有包裹。但为什么发现写?如何解决发现的包?

1 个答案:

答案 0 :(得分:0)

如果下一个版本与项目中的其他库冲突,或者您的composer.json中包含确切版本,则无法更新。

Laravel有自己的composer.json,它描述了那些库的版本(它是我的Laravel 5.4的json):

    "symfony/console": "~3.2", // ~3.2 means 3.2 ONLY
    "symfony/debug": "~3.2",
    "symfony/finder": "~3.2",
    "symfony/http-foundation": "~3.2",

决定作曲家的是composer.json