Cron (liebig/cron) 在新安装的 Laravel 5 上破坏了 Artisan

问题描述 投票:0回答:1

安装过程的第4步中,尝试运行 Artisan 迁移时出现错误(如下):

四处挖掘,我发现了 Laracasts 论坛上的讨论,其中指出这可能与 Laravel 5 的新结构有关。

有人对此有任何想法吗?

exception 'BadMethodCallException' with message 'Call to undefined method [package]' in /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:226
Stack trace:
#0 /home/vagrant/myApplication/vendor/liebig/cron/src/Liebig/Cron/CronServiceProvider.php(22): Illuminate\Support\ServiceProvider->__call('package', Array)
#1 /home/vagrant/myApplication/vendor/liebig/cron/src/Liebig/Cron/CronServiceProvider.php(22): Liebig\Cron\CronServiceProvider->package('liebig/cron')
#2 [internal function]: Liebig\Cron\CronServiceProvider->boot()
#3 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Container/Container.php(523): call_user_func_array(Array, Array)
#4 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(631): Illuminate\Container\Container->call(Array)
#5 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(613): Illuminate\Foundation\Application->bootProvider(Object(Liebig\Cron\CronServiceProvider))
#6 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}(Object(Liebig\Cron\CronServiceProvider), 19)
#7 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(614): array_walk(Array, Object(Closure))
#8 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(15): Illuminate\Foundation\Application->boot()
#9 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(165): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap(Object(Illuminate\Foundation\Application))
#10 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(192): Illuminate\Foundation\Application->bootstrapWith(Array)
#11 /home/vagrant/myApplication/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(89): Illuminate\Foundation\Console\Kernel->bootstrap()
#12 /home/vagrant/myApplication/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 {main}

问题已发布在 Cron 的 GitHub 中。

php laravel laravel-5 cron laravel-artisan
1个回答
1
投票

Laravel 5 不需要这个包。

从一开始就内置了安排 crons 的能力。

$schedule->command('foo')->daily();

您可以在 Laravel 5 文档中阅读有关调度 artisan 命令的信息

© www.soinside.com 2019 - 2024. All rights reserved.