]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
The worker is now working
[friendica.git] / boot.php
index 7f3238013a779c3f720f04f4e71335b6cf930438..b3b926521919662dda81da660f503be4bb309d36 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1433,21 +1433,24 @@ if(! function_exists('proc_run')) {
                        return;
 
                if(count($args) && $args[0] === 'php') {
-                       $argv = $args;
-                       array_shift($argv);
 
-                       $parameters = json_encode($argv);
-                       $found = q("SELECT `id` FROM `workerqueue` WHERE `parameter` = '%s'",
-                                       dbesc($parameters));
+                       if (get_config("system", "worker")) {
+                               $argv = $args;
+                               array_shift($argv);
 
-                       if (!$found)
-                               q("INSERT INTO `workerqueue` (`parameter`, `created`, `priority`)
-                                                       VALUES ('%s', '%s', %d)",
-                                       dbesc($parameters),
-                                       dbesc(datetime_convert()),
-                                       intval(0));
+                               $parameters = json_encode($argv);
+                               $found = q("SELECT `id` FROM `workerqueue` WHERE `parameter` = '%s'",
+                                               dbesc($parameters));
 
-                       // return;
+                               if (!$found)
+                                       q("INSERT INTO `workerqueue` (`parameter`, `created`, `priority`)
+                                                               VALUES ('%s', '%s', %d)",
+                                               dbesc($parameters),
+                                               dbesc(datetime_convert()),
+                                               intval(0));
+
+                               return;
+                       }
 
                        $args[0] = ((x($a->config,'php_path')) && (strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
                }