Upgrade to Laravel 4.1 error

回眸只為那壹抹淺笑 提交于 2019-12-11 13:31:56

问题


I believe I have all my dependencies ready for 4.1, but I get the following errors when I use composer update:

Generating autoload files

Script php artisan clear-compiled handling the post-update-cmd event returned with an error:

Script php artisan optimize handling the post-update-cmd event returned with an error:

My composer file is as follows:

{

"require": {

    "laravel/framework": "4.1.*",
    "jasonlewis/basset": "dev-master",
    "twbs/bootstrap": "dev-master",
            "frozennode/administrator": "dev-master",
            "bllim/datatables": "*",
            "scubaclick/mandrill": "dev-develop"
},
"require-dev": {
    "codeception/codeception": "1.8.*",
    "way/generators": "dev-master"
},
"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php",
        "app/Acme/Apis/v1"
    ],
    "psr-0": {
        "Acme" : "app/"
    }
},
"scripts": {
    "post-install-cmd": [
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "dev"

}


回答1:


Normally you will get this kind of errors if you don't have proper route to any of your class file in autoload_classmap.php file from composer directory and you are still using that file.

This can be solved by executing php artisan dump-autoload file before using your new file.

If you're already using that file than please comment that part, run php artisan dump-autoload and then uncomment those line which were commented earlier.




回答2:


You would have needed to do composer update --no-scripts to update all your composer files without running the artisan commands; the reason for this is until composer has finished artisan would be broken by the upgrading and the default composer.json file has the command php artisan clear-compiled set to run before the vendor folder is updated.

If all else fails then delete your vendor directory and the composer.lock file and then run composer install




回答3:


At the time the upgrade process required me to take that post compile out, run it, then do it again. I did finally get it to work, but it was not smooth.



来源:https://stackoverflow.com/questions/20354763/upgrade-to-laravel-4-1-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!