Publication initiale de RelaisSMS : documentation et sources nettoyees
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\CardDav\CardDavContactSyncService;
|
||||
use Illuminate\Console\Command;
|
||||
use Throwable;
|
||||
|
||||
class SyncCardDavContactsCommand extends Command
|
||||
{
|
||||
protected $signature = 'contacts:sync-carddav';
|
||||
|
||||
protected $description = 'Synchronise les contacts depuis le carnet CardDAV configure.';
|
||||
|
||||
public function handle(CardDavContactSyncService $syncService): int
|
||||
{
|
||||
try {
|
||||
$run = $syncService->sync();
|
||||
} catch (Throwable $exception) {
|
||||
$this->error('Synchronisation CardDAV en echec : '.$exception->getMessage());
|
||||
|
||||
return self::FAILURE;
|
||||
}
|
||||
|
||||
$this->info((string) $run->message);
|
||||
$this->line('Contacts lus : '.$run->fetched_contacts);
|
||||
$this->line('Contacts synchronises : '.$run->synced_contacts);
|
||||
$this->line('Contacts supprimes localement : '.$run->deleted_contacts);
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user