mode = $mode; $this->basePath = $basePath; $this->processRepo = $processRepo; } protected function getHelp(): string { return <<checkDeprecated('worker'); $this->mode->setExecutor(Mode::WORKER); // Check the database structure and possibly fixes it Update::check($this->basePath->getPath(), true); // Quit when in maintenance if (!$this->mode->has(Mode::MAINTENANCEDISABLED)) { return; } $spawn = $this->getOption(['s', 'spawn'], false); if ($spawn) { CoreWorker::spawnWorker(); exit(); } $run_cron = !$this->getOption(['n', 'no_cron'], false); $process = $this->processRepo->create(getmypid(), 'worker.php'); CoreWorker::processQueue($run_cron, $process); CoreWorker::unclaimProcess($process); $this->processRepo->delete($process); } }