Do the directory change only when it is needed.

pull/1407/head
Michael Vogel 8 years ago
parent 96c642661e
commit 6d8c126179
  1. 15
      include/poller.php

@ -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");

Loading…
Cancel
Save