简体   繁体   English

Laravel 5.1到5.2作曲家更新错误

[英]Laravel 5.1 to 5.2 composer update error

Whenever I try to run composer update I now receive an error with a root cause of the following 每当我尝试运行composer update时,我现在都会收到一个错误,其根本原因如下

Call to undefined method Illuminate\\Bus\\Dispatcher::mapUsing() 调用未定义的方法Illuminate \\ Bus \\ Dispatcher :: mapUsing()

I can confirm Laravel 5.2 is properly installed, as are all other dependencies. 我可以确认Laravel 5.2已正确安装,所有其他依赖项也是如此。 This only happens when php artisan clear-compiled is run. 这只发生在运行php artisan clear-compiled时。

I've also updated my base controller based on a suggestion from a few hours ago in the Laracasts forum 我还根据几小时前在Laracasts论坛上提出的建议更新了我的基本控制器

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

abstract class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}

But I still receive the error 但我仍然收到错误

UPDATE: This happens whenever the application is bootstrapped at all. 更新:只要应用程序完全自举,就会发生这种情况。 My app won't even run now. 我的应用程序现在甚至不会运行。

UPDATE 2, full stack trace: 更新2,完整堆栈跟踪:

PHP Fatal error:  Call to undefined method Illuminate\Bus\Dispatcher::mapUsing() in /Users/Zara/Web/cafe/app/Providers/BusServiceProvider.php on line 16
PHP Stack trace:
PHP   1. {main}() /Users/Zara/Web/cafe/artisan:0
PHP   2. Illuminate\Foundation\Console\Kernel->handle() /Users/Zara/Web/cafe/artisan:36
PHP   3. Illuminate\Foundation\Console\Kernel->bootstrap() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:105
PHP   4. Illuminate\Foundation\Application->bootstrapWith() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:208
PHP   5. Illuminate\Foundation\Bootstrap\BootProviders->bootstrap() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:203
PHP   6. Illuminate\Foundation\Application->boot() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17
PHP   7. array_walk() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:718
PHP   8. Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:718
PHP   9. Illuminate\Foundation\Application->bootProvider() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:717
PHP  10. Illuminate\Container\Container->call() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:734
PHP  11. call_user_func_array:{/Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Container/Container.php:507}() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Container/Container.php:507
PHP  12. Cafe\Providers\BusServiceProvider->boot() /Users/Zara/Web/cafe/vendor/laravel/framework/src/Illuminate/Container/Container.php:507



  [Symfony\Component\Debug\Exception\FatalErrorException]
  Call to undefined method Illuminate\Bus\Dispatcher::mapUsing()

From the Laravel 5.2 Upgrade Guide 从Laravel 5.2升级指南

Separate Commands & Handlers 单独的命令和处理程序

The Laravel 5.2 command bus now only supports self-handling commands and no longer supports separate commands and handlers. Laravel 5.2命令总线现在仅支持自我处理命令,不再支持单独的命令和处理程序。

If you would like to continue using separate commands and handlers, you may install a Laravel Collective package which provides backwards-compatible support for this: https://github.com/LaravelCollective/bus 如果您想继续使用单独的命令和处理程序,您可以安装Laravel Collective程序包,为此提供向后兼容的支持: https//github.com/LaravelCollective/bus

There is no longer support for non self handling commands which is what the mapper would be for; 不再支持非自我处理命令,这是映射器的用途; mapping commands to handlers. 将命令映射到处理程序。

Check Service Providers 检查服务提供商

Check any service providers you have registered to make sure they aren't calling that method on dispatcher. 检查您已注册的任何服务提供商,以确保他们没有在调度程序上调用该方法。 If still having that issue, you can try checking any package service providers to make sure they aren't calling that method. 如果仍然遇到此问题,您可以尝试检查任何包服务提供商,以确保他们没有调用该方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM