当前位置:  开发笔记 > 编程语言 > 正文

Laravel 5.1到5.2升级错误

如何解决《Laravel5.1到5.2升级错误》经验,为你挑选了0个好方法。

当我尝试使用官方指南将我们现有的项目从Laravel 5.1更新到Laravel 5.2时,在更新后的作曲家更新后我收到错误

php artisan clear-compiled

运行.这是错误.

类Illuminate\Foundation\Composer不存在

有人有过类似的问题吗?当我使用无脚本标志运行composer update时,它会定期更新,因此在clear-compiled上出现问题.

以下是我的服务提供商和我的composer.json文件.

服务供应商

    Illuminate\Auth\AuthServiceProvider::class,
    Illuminate\Broadcasting\BroadcastServiceProvider::class,
    Illuminate\Bus\BusServiceProvider::class,
    Illuminate\Cache\CacheServiceProvider::class,
    Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
    Illuminate\Cookie\CookieServiceProvider::class,
    Illuminate\Database\DatabaseServiceProvider::class,
    Illuminate\Encryption\EncryptionServiceProvider::class,
    Illuminate\Filesystem\FilesystemServiceProvider::class,
    Illuminate\Foundation\Providers\FoundationServiceProvider::class,
    Illuminate\Hashing\HashServiceProvider::class,
    Illuminate\Mail\MailServiceProvider::class,
    Illuminate\Pagination\PaginationServiceProvider::class,
    Illuminate\Pipeline\PipelineServiceProvider::class,
    Illuminate\Queue\QueueServiceProvider::class,
    // Illuminate\Redis\RedisServiceProvider::class,
    Vetruvet\PhpRedis\PhpRedisServiceProvider::class,
    Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
    Illuminate\Session\SessionServiceProvider::class,
    Illuminate\Translation\TranslationServiceProvider::class,
    Illuminate\Validation\ValidationServiceProvider::class,
    Illuminate\View\ViewServiceProvider::class,
    Collective\Html\HtmlServiceProvider::class,
    Laravel\Socialite\SocialiteServiceProvider::class,
    Intervention\Image\ImageServiceProvider::class,
    Torann\GeoIP\GeoIPServiceProvider::class,
    Jenssegers\Agent\AgentServiceProvider::class,
    Barryvdh\Debugbar\ServiceProvider::class,

composer.json

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "fzaninotto/faker": "^1.6@dev",
    "laravelcollective/html": "5.2.*",
    "laravelcollective/remote": "~5.2",
    "kriswallsmith/assetic": "^1.3@dev",
    "pda/pheanstalk": "^3.0@dev",
    "aws/aws-sdk-php-laravel": "~3.0",
    "illuminate/http": "~5.2",
    "illuminate/session": "~5.2",
    "illuminate/support": "~5.2",
    "nesbot/carbon": "~1.18",
    "guzzlehttp/guzzle": "~5.3|~6.0",
    "vetruvet/laravel-phpredis": "dev-master",
    "predis/predis": "^1.1@dev",
    "laravel/socialite": "^3.0@dev",
    "intervention/image": "^2.3@dev",
    "brightcove/api": "^1.0@dev",
    "torann/geoip": "dev-master",
    "graham-campbell/throttle": "~5.1",
    "jenssegers/agent": "^3.0@dev"
},
"require-dev": {
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "phpspec/phpspec": "~2.1",
    "symfony/dom-crawler": "~3.0",
    "symfony/css-selector": "~3.0",
    "barryvdh/laravel-debugbar": "^2.0@dev",
    "laracasts/generators": "dev-master"
},
"repositories": [
    {
        "type": "git",
        "url": "https://github.com/nardev/laravel-vzaar.git"
    }
],
"autoload": {
    "classmap": [
        "database",
        "app/Models",
        "app/Footgoll"
    ],
    "files": [
        "app/helpers.php"
    ],
    "psr-4": {
        "Myapp\\": "app/"
    }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "dev",
"prefer-stable": true
}

我跑的时候

grep -nH -d recurse'Composer'bootstrap/app/config /

这是返回的内容:

引导/ autoload.php:7:| 注册Composer Auto Loader bootstrap/autoload.php:10:| Composer提供了一个方便的,自动生成的类加载器bootstrap/autoload.php:42:| 在当地工作.但是我们需要加载Composer

这是autoload.php文件的样子:

    

它可能是工作台的一部分吗?

更新:将Composer.php从5.1返回到vendor/laravel/framework/src/Illuminate/Foundation的一个非常可怕的修复程序让应用程序正常运行,但我真的需要一个更好的解决方案,一个可以推向生产的解决方案.

推荐阅读
360691894_8a5c48
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有