]> git.mxchange.org Git - friendica.git/commitdiff
Do the directory change only when it is needed.
authorMichael Vogel <icarus@dabo.de>
Thu, 19 Feb 2015 09:45:46 +0000 (10:45 +0100)
committerMichael Vogel <icarus@dabo.de>
Thu, 19 Feb 2015 09:45:46 +0000 (10:45 +0100)
include/poller.php

index f95d3b180787209720373ef8d102f9b41ba4f3cf..cefa713a0d5c11eef6cf5e8de8314327c56878d4 100644 (file)
@@ -1,15 +1,14 @@
 <?php
-if (sizeof($_SERVER["argv"]) == 0)
-       die();
+if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
+       $directory = dirname($_SERVER["argv"][0]);
 
-$directory = dirname($_SERVER["argv"][0]);
+       if (substr($directory, 0, 1) != "/")
+               $directory = $_SERVER["PWD"]."/".$directory;
 
-if (substr($directory, 0, 1) != "/")
-       $directory = $_SERVER["PWD"]."/".$directory;
+       $directory = realpath($directory."/..");
 
-$directory = realpath($directory."/..");
-
-chdir($directory);
+       chdir($directory);
+}
 
 require_once("boot.php");