]> git.mxchange.org Git - friendica-addons.git/blobdiff - pumpio/pumpio_sync.php
Merge pull request #415 from Hypolite/task/replace-explicit-php-logical-operators
[friendica-addons.git] / pumpio / pumpio_sync.php
index 346376fa00d6fde9d26e40f1e972441a7d4607cb..51efe9c4c61b182a0592dd7c9263aafab3267d55 100644 (file)
@@ -1,5 +1,8 @@
 <?php
-if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
+
+use Friendica\App;
+
+if (!file_exists("boot.php") && (sizeof($_SERVER["argv"]) != 0)) {
        $directory = dirname($_SERVER["argv"][0]);
 
        if (substr($directory, 0, 1) != "/")
@@ -41,21 +44,23 @@ function pumpio_sync_run(&$argv, &$argc){
                }
        }
 
-       $lockpath = get_lockpath();
-       if ($lockpath != '') {
-               $pidfile = new pidfile($lockpath, 'pumpio_sync');
-               if($pidfile->is_already_running()) {
-                       logger("Already running");
-                       if ($pidfile->running_time() > 9*60) {
-                               $pidfile->kill();
-                               logger("killed stale process");
-                               // Calling a new instance
-                               proc_run('php','addon/pumpio/pumpio_sync.php');
+       // This is deprecated with the worker
+       if (function_exists("get_lockpath")) {
+               $lockpath = get_lockpath();
+               if ($lockpath != '') {
+                       $pidfile = new pidfile($lockpath, 'pumpio_sync');
+                       if($pidfile->is_already_running()) {
+                               logger("Already running");
+                               if ($pidfile->running_time() > 9*60) {
+                                       $pidfile->kill();
+                                       logger("killed stale process");
+                                       // Calling a new instance
+                                       proc_run('php','addon/pumpio/pumpio_sync.php');
+                               }
+                               exit;
                        }
-                       exit;
                }
        }
-
        pumpio_sync($a);
 }