3 use Friendica\Core\Worker;
4 use Friendica\Core\Config;
6 if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
7 $directory = dirname($_SERVER["argv"][0]);
9 if (substr($directory, 0, 1) != "/") {
10 $directory = $_SERVER["PWD"]."/".$directory;
12 $directory = realpath($directory."/..");
17 require_once("boot.php");
19 function poller_run($argv, $argc) {
23 $a = new App(dirname(__DIR__));
26 require_once ".htconfig.php";
27 require_once "include/dba.php";
28 dba::connect($db_host, $db_user, $db_pass, $db_data);
29 unset($db_host, $db_user, $db_pass, $db_data);
33 // Check the database structure and possibly fixes it
36 // Quit when in maintenance
37 if (Config::get('system', 'maintenance', true)) {
41 $a->set_baseurl(Config::get('system', 'url'));
45 $run_cron = (($argc <= 1) || ($argv[1] != "no_cron"));
46 Worker::processQueue($run_cron);
50 if (array_search(__file__, get_included_files()) === 0) {
51 poller_run($_SERVER["argv"], $_SERVER["argc"]);
53 Worker::unclaimProcess();
55 get_app()->end_process();