Context::getInstance가 전역 변수 대신 함수 static 변수를 이용하도록 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4260 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
wdlee91 2008-06-09 12:11:06 +00:00
parent 165b8a7117
commit 65dca87956

View file

@ -48,14 +48,15 @@
var $is_uploaded = false; ///< @brief 첨부파일이 업로드 된 요청이였는지에 대한 체크 플래그
/**
* @brief Context 객체를 GLOBALS 변수에 생성
* @brief 유일한 Context 객체를 반환 (Singleton)
*
* Context는 어디서든 객체 선언없이 사용하기 위해서 static 하게 사용\n
* php5라면 GLOBALS가 아닌 static으로 처리 가능
* Context는 어디서든 객체 선언없이 사용하기 위해서 static 하게 사용
**/
function &getInstance() {
if(!$GLOBALS['__ContextInstance__']) $GLOBALS['__ContextInstance__'] = new Context();
return $GLOBALS['__ContextInstance__'];
static $theInstance = null;
if(!$theInstance)
$theInstance = new Context();
return $theInstance;
}
/**