News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1327107545:v:use_geshi-1:v:type-php

Started by SleePy, Jan 21, 2012, 12:59 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

SleePy

/*
* userInfo as a class.  We kinda do a poor method, but its the best way for now.
*/
class userInfo
{
   public static $instanceID = 0;

   public static function _()
   {
      if (self::$instanceID == 0)
         self::$instanceID = new userInfo;

      return self::$instanceID;
   }

   public function __set($key, $value)
   {
      global $user_info;
      $user_info[$key] = $value;
   }

   public function __get($key)
   {
      global $user_info;
      return $user_info[$key];
   }

   public function __isset($key)
   {
      global $user_info;
      return isset($user_info[$key]);
   }

   public function __unset($key)
   {
      global $user_info;
      unset($user_info[$key], $user_info[$key]);
   }
}
No siggy! :D

SleePy

/*
* userInfo as a class.  We kinda do a poor method, but its the best way for now.
*/
class userInfo
{
   public static $instanceID = 0;

   public static function _()
   {
      if (self::$instanceID == 0)
         self::$instanceID = new userInfo;

      return self::$instanceID;
   }

   public function __set($key, $value)
   {
      global $user_info;
      $user_info[$key] = $value;
   }

   public function __get($key)
   {
      global $user_info;
      return isset($user_info[$key]) ? $user_info[$key] : null;
   }

   public function __isset($key)
   {
      global $user_info;
      return isset($user_info[$key]);
   }

   public function __unset($key)
   {
      global $user_info;
      unset($user_info[$key], $user_info[$key]);
   }
}
No siggy! :D