/
githubmirror
/
framework
Обзор
Документация
Войти
/
githubmirror
/
framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
13.x
src/Illuminate/Console/Scheduling/SchedulePauseCommand.php
42 строки
1 KB
Lucas Michot
[13.x] Use self::SUCCESS/self::FAILURE in console commands (#60928)
30 июл 2026, 23:27
Не верифицирован
30 июл 2026, 23:27
053a0f3
Код
Авторство
О чём код?
<?php namespace Illuminate\Console\Scheduling; use Illuminate\Console\Command; use Illuminate\Console\Events\SchedulePaused; use Illuminate\Contracts\Cache\Repository as Cache; use Illuminate\Contracts\Events\Dispatcher; use Symfony\Component\Console\Attribute\AsCommand; #[AsCommand(name: 'schedule:pause')] class SchedulePauseCommand extends Command { /** * The console command description. * * @var string */ protected $description = 'Pause the scheduler'; /** * Execute the console command. * * @return int */ public function handle(Cache $cache, Dispatcher $dispatcher) { if (! Schedule::$pausable) { $this->components->error('Schedule pausing is currently disabled.'); return self::FAILURE; } $cache->forever('illuminate:schedule:paused', true); $dispatcher->dispatch(new SchedulePaused); $this->components->info('Scheduled task processing has been paused.'); return self::SUCCESS; } }