3 use Friendica\Core\Worker;
4 use Friendica\Core\Config;
6 // Ensure that worker.php is executed from the base path of the installation
7 if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
8 $directory = dirname($_SERVER["argv"][0]);
10 if (substr($directory, 0, 1) != "/") {
11 $directory = $_SERVER["PWD"]."/".$directory;
13 $directory = realpath($directory."/..");
18 require_once "boot.php";
19 require_once "include/dba.php";
21 $a = new App(dirname(__DIR__));
23 require_once ".htconfig.php";
24 dba::connect($db_host, $db_user, $db_pass, $db_data);
25 unset($db_host, $db_user, $db_pass, $db_data);
29 // Check the database structure and possibly fixes it
32 // Quit when in maintenance
33 if (Config::get('system', 'maintenance', true)) {
37 $a->set_baseurl(Config::get('system', 'url'));
41 $run_cron = (($_SERVER["argc"] <= 1) || ($_SERVER["argv"][1] != "no_cron"));
42 Worker::processQueue($run_cron);
44 Worker::unclaimProcess();