コード例 #1
0
 /**
  * Returns an instance of the CredentialStore. Only
  * one instance is allowed to exist at runtime.
  */
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new SBTCredentialStore();
     }
     return self::$instance;
 }
コード例 #2
0
 public static function getInstance($cookieAdapter = null)
 {
     if ($cookieAdapter == null) {
         $cookieAdapter = new SBTPHPCookieAdapter();
     }
     SBTCookie::init($cookieAdapter);
     if (self::$instance == null) {
         self::$instance = new SBTCredentialStore($cookieAdapter);
     }
     return self::$instance;
 }