1 | <?php |
||
9 | class SyncCaldav extends Command |
||
10 | { |
||
11 | const BACKGROUND_MOD_MEX = 'background mode'; |
||
12 | const BACKGROUND_COMPLETED_MEX = 'All background tasks started'; |
||
13 | |||
14 | /** |
||
15 | * The name and signature of the console command. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $signature = 'sync:caldav {calendarId?} {--background}'; |
||
20 | |||
21 | /** |
||
22 | * The console command description. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $description = 'Sync caldav accounts'; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * @var Schedule laravel schedule object needed to perform command in background |
||
31 | */ |
||
32 | private $schedule; |
||
33 | |||
34 | |||
35 | /** |
||
36 | * Create a new command instance. |
||
37 | * @param Schedule $schedule |
||
38 | * |
||
39 | */ |
||
40 | 6 | public function __construct(Schedule $schedule) |
|
45 | |||
46 | /** |
||
47 | * Execute the console command. |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | 6 | public function handle() |
|
60 | |||
61 | 6 | private function syncAll() |
|
75 | |||
76 | /** |
||
77 | * sync calendars via exec command |
||
78 | * @param Caldav $calendar |
||
79 | */ |
||
80 | 2 | private function makeBackground(Caldav $calendar) |
|
86 | |||
87 | /** |
||
88 | * sync calendars foreground |
||
89 | * @param Caldav $calendar |
||
90 | */ |
||
91 | 4 | private function makeForeground(Caldav $calendar) |
|
97 | } |
||
98 |