コード例 #1
0
ファイル: Singleton.php プロジェクト: vasa00739/php.local
 public static function getInstance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
コード例 #2
0
ファイル: Singleton.php プロジェクト: slim12kg/Anastat
 /**
  * Allow only one instance of this class exist
  * for a single request
  */
 public static function instance()
 {
     $called = get_called_class();
     if (self::$instance instanceof self) {
         return self::$instance;
     }
     return self::$instance = new self();
 }
コード例 #3
0
ファイル: singleton.php プロジェクト: dimichspb/soap-example
 public static function getInstance()
 {
     return self::$_instance ?: (self::$_instance = new self());
 }