demisang / php-gearman

Gearman job server workers helper
GNU General Public License v3.0
17 stars 10 forks source link

laravel 5.5 Call to undefined method Illuminate\Foundation\Application::share() #1

Open gozhhu opened 6 years ago

gozhhu commented 6 years ago

Warning: Ambiguous class resolution, "demi\gearman\laravel5\Console\SupervisorCommand" was found in both "./vendor/demi/php-gearman/laravel5/console/SupervisorCommand.php" and "./vendor/demi/php-gearman/laravel5/Console/SupervisorCommand.php", the first will be used.

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover

In GearmanServiceProvider.php line 34:

Call to undefined method Illuminate\Foundation\Application::share()

gozhhu commented 6 years ago

//$this->app['command.gearman'] = $this->app->share( $this->app->singleton('command.gearman',

but another problem is: ` php artisan gearman

In BoundMethod.php line 135: Method demi\gearman\laravel5\Console\SupervisorCommand::handle() does not exist `

Maybe we need change "SupervisorCommand::fire" to "SupervisorCommand::handle"?

demisang commented 6 years ago

Fixed

sanket-mahure commented 6 years ago

In GearmanServiceProvider.php line 40:
Call to undefined method Illuminate\Foundation\Application::share()

Changed to $this->app->singleton('command.gearman', function ($app) { return new \demi\gearman\laravel5\Console\SupervisorCommand(); }); and is working but change is fine for Laravel 5.4?

demisang commented 6 years ago

I don't use Laravel very long time and don't have time for bug fixes... You can make pull-request 😀