server: fix bug that prevented PHP scripts from working

This commit is contained in:
David Anderson 2014-06-12 18:38:38 -07:00
parent bc6cf03a89
commit 4208b640d6
1 changed files with 7 additions and 3 deletions

View File

@ -21,13 +21,17 @@
$generating_xml = false;
function project_dir() {
return dirname(dirname(getcwd()));
}
function web_stopped() {
$d = dirname(dirname(dirname($_SERVER["SCRIPT_FILENAME"])));
$d = project_dir();
return file_exists("$d/stop_web");
}
function sched_stopped() {
$d = dirname(dirname(dirname($_SERVER["SCRIPT_FILENAME"])));
$d = project_dir();
return file_exists("$d/stop_sched");
}
@ -68,7 +72,7 @@ $g_config = null;
function get_config() {
global $g_config;
if ($g_config == null) {
$d = dirname(dirname(dirname($_SERVER["SCRIPT_FILENAME"])));
$d = project_dir();
$g_config = file_get_contents("$d/config.xml");
}
return $g_config;