]> git.mxchange.org Git - friendica.git/blobdiff - bin/worker.php
Merge pull request #5862 from nupplaphil/rename_App_Methods
[friendica.git] / bin / worker.php
index 0f8dd98adb89cc82babf034d5ac23c59022c9da3..cb09a4929da9fe0c445baca4361445902687531f 100755 (executable)
@@ -9,11 +9,11 @@ use Friendica\App;
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\Worker;
+use Friendica\Core\L10n;
 
 // Get options
-$shortopts  = '';
-$shortopts .= 'sc';
-$longopts = [ 'spawn', 'cron' ];
+$shortopts = 'sn';
+$longopts = ['spawn', 'no_cron'];
 $options = getopt($shortopts, $longopts);
 
 // Ensure that worker.php is executed from the base path of the installation
@@ -34,6 +34,9 @@ $a = new App(dirname(__DIR__));
 
 Config::load();
 
+$lang = L10n::getBrowserLanguage();
+L10n::loadTranslationTable($lang);
+
 // Check the database structure and possibly fixes it
 check_db(true);
 
@@ -42,7 +45,7 @@ if (Config::get('system', 'maintenance', false, true)) {
        return;
 }
 
-$a->set_baseurl(Config::get('system', 'url'));
+$a->setBaseURL(Config::get('system', 'url'));
 
 Addon::loadHooks();
 
@@ -53,7 +56,7 @@ if ($spawn) {
        killme();
 }
 
-$run_cron = array_key_exists('c', $options) || array_key_exists('cron', $options);
+$run_cron = !array_key_exists('n', $options) && !array_key_exists('no_cron', $options);
 
 Worker::processQueue($run_cron);