#!/usr/bin/env php addRules(include __DIR__ . '/../static/dependencies.config.php'); $dice = $dice->addRule(LoggerInterface::class,['constructParams' => ['worker']]); DI::init($dice); $a = DI::app(); // Check the database structure and possibly fixes it Update::check($a->getBasePath(), true, DI::mode()); // Quit when in maintenance if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { return; } DI::baseUrl()->saveByURL(Config::get('system', 'url')); $spawn = array_key_exists('s', $options) || array_key_exists('spawn', $options); if ($spawn) { Worker::spawnWorker(); exit(); } $run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options); Worker::processQueue($run_cron); Worker::unclaimProcess(); Worker::endProcess();