Aaron Schulz has submitted this change and it was merged.

Change subject: Enabled the schema updater hook
......................................................................


Enabled the schema updater hook

Change-Id: I56da84db459a38973f8271137bf5fe569f436d8a
---
M OAuth.php
M OAuth.setup.php
M backend/schema/MWOAuthUpdater.hooks.php
3 files changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  Aaron Schulz: Verified



diff --git a/OAuth.php b/OAuth.php
index 0023574..e3177b2 100644
--- a/OAuth.php
+++ b/OAuth.php
@@ -52,6 +52,8 @@
 MWOAuthUISetup::defineLogBasicDescription( $wgLogNames, $wgLogHeaders, 
$wgFilterLogTypes );
 MWOAuthUISetup::defineLogActionHandlers( $wgLogActions, $wgLogActionsHandlers 
);
 
+# Basic hook handlers
+MWOAuthSetup::defineHookHandlers( $wgHooks );
 # GUI-related hook handlers
 MWOAuthUISetup::defineHookHandlers( $wgHooks );
 # API-related hook handlers
diff --git a/OAuth.setup.php b/OAuth.setup.php
index eb1aef9..f2540d5 100644
--- a/OAuth.setup.php
+++ b/OAuth.setup.php
@@ -80,4 +80,12 @@
                # Schema changes
                $classes['MWOAuthUpdaterHooks'] = 
"$schemaDir/MWOAuthUpdater.hooks.php";
        }
+
+       /**
+        * @param array $hooks $wgHooks
+        * @return void
+        */
+       public static function defineHookHandlers( &$hooks ) {
+               $hooks['LoadExtensionSchemaUpdates'][] = 
'MWOAuthUpdaterHooks::addSchemaUpdates';
+       }
 }
diff --git a/backend/schema/MWOAuthUpdater.hooks.php 
b/backend/schema/MWOAuthUpdater.hooks.php
index 388d50d..861e5bf 100644
--- a/backend/schema/MWOAuthUpdater.hooks.php
+++ b/backend/schema/MWOAuthUpdater.hooks.php
@@ -3,17 +3,19 @@
  * Class containing updater functions for an OAuth environment
  */
 class MWOAuthUpdaterHooks {
-
        /**
         * @param DatabaseUpdater $updater
         * @return bool
         */
        public static function addSchemaUpdates( DatabaseUpdater $updater ) {
+               if ( !MWOAuthUtils::isCentralWiki() ) {
+                       return true; // no tables to add
+               }
                $base = dirname( __FILE__ );
                if ( $updater->getDB()->getType() == 'mysql' ) {
                        $base = "$base/mysql";
 
-                       // $updater->addExtensionTable( 'oauth_registration', 
"$base/OAuth.sql" );
+                       $updater->addExtensionTable( 
'oauth_registered_consumer', "$base/OAuth.sql" );
                } elseif ( $updater->getDB()->getType() == 'postgres' ) {
                        $base = "$base/postgres";
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I56da84db459a38973f8271137bf5fe569f436d8a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: CSteipp <[email protected]>

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

Reply via email to