kernel = $kernel; } public function onInit(TaskInitEvent $event) { $event->addTask('caldav:sync', '📅 Calendrier', 'Synchronisation'); } public function onRunRequest(TaskRunRequestedEvent $event) { if ('caldav:sync' !== $event->getTask()) { return; } $application = new Application($this->kernel); $application->setAutoExit(false); $input = new ArrayInput([ 'command' => 'caldav:sync', '-e' => $this->kernel->getEnvironment(), ]); $application->run($input, $event->getOutput()); } }