示例#1
0
 public static function GetInstance()
 {
     if (self::$instance == null) {
         self::$instance = new DataManager();
     }
     return self::$instance;
 }
示例#2
0
 public static function singleton($args = NULL)
 {
     $name = __CLASS__;
     if (!self::$instance) {
         if (!empty($args)) {
             self::$instance = new $name($args);
         } else {
             self::$instance = null;
         }
     }
     return self::$instance;
 }