コード例 #1
0
ファイル: SimpleLog.php プロジェクト: makopov/simple-log
 /**
  * Singelton implementation, returns the same instance of SimpleLog
  * @return SimpleLog
  */
 public static function getInstance()
 {
     if (static::$oInstance == null) {
         static::$oInstance = new SimpleLog();
     }
     return static::$oInstance;
 }
コード例 #2
0
ファイル: Recaptcha.php プロジェクト: tlandn/akvo-web
 /**
  *
  * @return Recaptcha
  */
 public static function getInstance()
 {
     if (is_null(static::$oInstance)) {
         static::$oInstance = new static();
     }
     return static::$oInstance;
 }
コード例 #3
0
ファイル: Storage.class.php プロジェクト: ZeoNish/altocms
 /**
  * @return Storage
  */
 public static function getInstance()
 {
     if (!is_null(static::$oInstance)) {
         return static::$oInstance;
     } else {
         static::$oInstance = new static();
         return static::$oInstance;
     }
 }
コード例 #4
0
ファイル: Router.class.php プロジェクト: hard990/altocms
 /**
  * Делает возможным только один экземпляр этого класса
  *
  * @return Router
  */
 public static function getInstance()
 {
     if (isset(static::$oInstance) && static::$oInstance instanceof self) {
         return static::$oInstance;
     } else {
         static::$oInstance = new static();
         return static::$oInstance;
     }
 }