added workaround for missing CGI PATH_INFO envvar

This commit is contained in:
Steffen Vogel 2010-09-05 22:13:29 +02:00
parent 800a1bb508
commit d225ba4f44
3 changed files with 5 additions and 2 deletions

View file

@ -84,7 +84,7 @@ class Router {
}
}
else {
throw new \Exception('no PATH_INFO found');
throw new \Exception('no CGI PATH_INFO envvar found');
}
}
@ -100,6 +100,9 @@ class Router {
elseif (isset($_SERVER['ORIG_PATH_INFO'])) {
return $_SERVER['ORIG_PATH_INFO'];
}
elseif (strlen($_SERVER['PHP_SELF']) > strlen($_SERVER['SCRIPT_NAME'])) {
return substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME']));
}
else {
return FALSE;
}
@ -114,4 +117,4 @@ class Router {
public function getAction() { return $this->action; }
}
?>
?>