#369 sapi type이 cgi일 경우 PATH_INFO 환경변수에서 경로를 구하도록 함. 그리고 index.php 파일을 제거할때 preg 정규표현식으로 대소문자 구별없이 제거하도록 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3514 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-01-09 05:27:34 +00:00
parent bd0ae1daef
commit 1dff2a4863
3 changed files with 9 additions and 6 deletions

View file

@ -463,4 +463,11 @@
return sprintf("%08lx%08lx", $nr, $nr2);
}
/**
* 현재 요청받은 스크립트 경로를 return
**/
function getScriptPath() {
if(function_exists('php_sapi_name') && php_sapi_name()=='cgi') return preg_replace('/index.php/i','',$_SERVER['PATH_INFO']);
return preg_replace('/index.php/i','',$_SERVER['SCRIPT_NAME']);
}
?>