CampSession::singleton PHP Method

singleton() public static method

Builds an instance object of this class only if there is no one.
public static singleton ( ) : CampSession
return CampSession
    public static function singleton()
    {
        if (!isset(self::$m_instance)) {
            self::$m_instance = new CampSession();
        }
        return self::$m_instance;
    }

Usage Example

Example #1
0
 public static function DeleteSystemPrefsFromCache()
 {
 	CampSession::singleton()->setData('system_preferences', null, 'default', true);
 	if (file_exists($GLOBALS['g_campsiteDir'].'/'.self::CACHE_FILE_NAME)) {
 		unlink($GLOBALS['g_campsiteDir'].'/'.self::CACHE_FILE_NAME);
 	}
 	return true;
 }
All Usage Examples Of CampSession::singleton