CSteipp has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74062


Change subject: Add MWOAuthServer::getServer()
......................................................................

Add MWOAuthServer::getServer()

to quickly get a new server with all the default configs

Change-Id: I8f96be9076fde27d7d1dcecf2d2169d140fed968
---
M backend/MWOAuthServer.php
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth 
refs/changes/62/74062/1

diff --git a/backend/MWOAuthServer.php b/backend/MWOAuthServer.php
index 73ed605..b35f7ae 100644
--- a/backend/MWOAuthServer.php
+++ b/backend/MWOAuthServer.php
@@ -143,6 +143,19 @@
        }
 
        /**
+        * Quickly get a new server with all the default configurations
+        */
+       public static function newServer() {
+               global $wgMemc;
+               $dbr = MWOAuthUtils::getCentralDB( DB_SLAVE );
+               $store = new MWOAuthDataStore( $wgMemc, $dbr );
+               $server = new MWOAuthServer( $store );
+               $server->add_signature_method( new 
OAuthSignatureMethod_HMAC_SHA1() );
+               $server->add_signature_method( new 
MWOAuthSignatureMethod_RSA_SHA1( $store ) );
+               return $server;
+       }
+
+       /**
         * Ensure we're using the correct user object, in case another 
extension wants to switch
         * it out. After this, $user->getId() is used to store/get Grants for 
this user.
         * @param User $user

-- 
To view, visit https://gerrit.wikimedia.org/r/74062
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f96be9076fde27d7d1dcecf2d2169d140fed968
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: CSteipp <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to