Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Console\Scheduling;
4
 
5
use Illuminate\Console\Command;
6
 
7
class ScheduleClearCacheCommand extends Command
8
{
9
    /**
10
     * The console command name.
11
     *
12
     * @var string
13
     */
14
    protected $name = 'schedule:clear-cache';
15
 
16
    /**
17
     * The console command description.
18
     *
19
     * @var string
20
     */
21
    protected $description = 'Delete the cached mutex files created by scheduler';
22
 
23
    /**
24
     * Execute the console command.
25
     *
26
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
27
     * @return void
28
     */
29
    public function handle(Schedule $schedule)
30
    {
31
        $mutexCleared = false;
32
 
33
        foreach ($schedule->events($this->laravel) as $event) {
34
            if ($event->mutex->exists($event)) {
35
                $this->components->info(sprintf('Deleting mutex for [%s]', $event->command));
36
 
37
                $event->mutex->forget($event);
38
 
39
                $mutexCleared = true;
40
            }
41
        }
42
 
43
        if (! $mutexCleared) {
44
            $this->components->info('No mutex files were found.');
45
        }
46
    }
47
}