/** * 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; }
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; }