Formated Paste

  1. /*
  2. * userInfo as a class. We kinda do a poor method, but its the best way for now.
  3. */
  4. class userInfo
  5. {
  6. public static $instanceID = 0;
  7.  
  8. public static function _()
  9. {
  10. if (self::$instanceID == 0)
  11. self::$instanceID = new userInfo;
  12.  
  13. return self::$instanceID;
  14. }
  15.  
  16. public function __set($key, $value)
  17. {
  18. global $user_info;
  19. $user_info[$key] = $value;
  20. }
  21.  
  22. public function __get($key)
  23. {
  24. global $user_info;
  25. return isset($user_info[$key]) ? $user_info[$key] : null;
  26. }
  27.  
  28. public function __isset($key)
  29. {
  30. global $user_info;
  31. return isset($user_info[$key]);
  32. }
  33.  
  34. public function __unset($key)
  35. {
  36. global $user_info;
  37. unset($user_info[$key], $user_info[$key]);
  38. }
  39. }
Name:
Email:
Code/text to paste:
  • Enable code highlighting
  • Code Language:
  • What software do we use to power the pastebin?: