#!/usr/bin/env php addRules(include __DIR__ . '/../static/dependencies.config.php'); BaseObject::setDependencyInjection($dice); $a = BaseObject::getApp(); // Check the database structure and possibly fixes it Update::check($a->getBasePath(), true, $a->getMode()); // Quit when in maintenance if (!$a->getMode()->has(App\Mode::MAINTENANCEDISABLED)) { return; } $a->setBaseURL(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();