예제 #1
0
 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = self::$mockmode ? new PreferencesMock() : new PreferencesImpl();
     }
     return self::$instance;
 }
예제 #2
0
 public static function getInstance()
 {
     if (empty(self::$instance)) {
         self::$instance = new Preferences();
     }
     return self::$instance;
 }
예제 #3
0
 public static function singleton($options = array())
 {
     if (!isset(self::$instance)) {
         self::$instance = new Preferences($options);
     }
     return self::$instance;
 }
예제 #4
0
 public static function getInstance()
 {
     if (empty(self::$instance)) {
         self::$instance = new Preferences();
         // если экземпляр не создан, создаём его
     }
     return self::$instance;
     // получаем экземпляр объекта этого класса
 }
예제 #5
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         try {
             self::$instance = new Preferences();
         } catch (Exception $e) {
             return false;
         }
     }
     return self::$instance;
 }