Do the directory change only when it is needed.

This commit is contained in:
Michael Vogel 2015-02-19 10:45:46 +01:00
parent 96c642661e
commit 6d8c126179
1 changed files with 7 additions and 8 deletions

View File

@ -1,7 +1,5 @@
<?php
if (sizeof($_SERVER["argv"]) == 0)
die();
if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]);
if (substr($directory, 0, 1) != "/")
@ -10,6 +8,7 @@ if (substr($directory, 0, 1) != "/")
$directory = realpath($directory."/..");
chdir($directory);
}
require_once("boot.php");