setDescription('Stops Phraseanet scheduler'); return $this; } protected function doExecute(InputInterface $input, OutputInterface $output) { if (false === $this->container['phraseanet.configuration']['main']['task-manager']['enabled']) { throw new RuntimeException('The use of the task manager is disabled on this instance.'); } try { $task_manager = $this->container['task-manager']; $task_manager->setSchedulerState(task_manager::STATE_TOSTOP); return 0; } catch (\Exception $e) { return 1; } return 0; } }