Changeset 4262 for sandbox

Show
Ignore:
Timestamp:
06/10/2008 09:29:20 AM (3 months ago)
Author:
zero
Message:

php4에서 function내에 static 지시자 사용가능함을 재확인하여 r4260 rollback

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • sandbox/classes/context/Context.class.php

    r4261 r4262  
    5151         * @brief 유일한 Context 객체를 반환 (Singleton) 
    5252         * 
    53          * Context는 어디서든 객체 선언없이 사용하기 위해서 GLOBALS 변수에 저장후 재사용 (php4 호환 때문에) 
     53         * Context는 어디서든 객체 선언없이 사용하기 위해서 GLOBALS 변수에 저장후 재사용  
    5454         **/ 
    5555        function &getInstance() { 
    56             if(!$GLOBALS['__ContextInstance__']) $GLOBALS['__ContextInstance__'] = new Context();  
    57             return $GLOBALS['__ContextInstance__'];  
     56            static $theInstance;  
     57            if(!isset($theInstance)) $theInstance = new Context();  
     58            return $theInstance;  
    5859        } 
    5960