jenkins-bot has submitted this change and it was merged. Change subject: Cleanup LoadExtensionSchemaUpdates hook ......................................................................
Cleanup LoadExtensionSchemaUpdates hook * Use standard "on{hook}" naming pattern * Skip hook if using an external database server ($wgEchoCluster) * Don't return true, it's not necessary anymore Change-Id: I488e4636f9499c468b870966614b0762c2ade8ea --- M Echo.php M Hooks.php 2 files changed, 7 insertions(+), 5 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/Echo.php b/Echo.php index 3d39973..4ea8699 100644 --- a/Echo.php +++ b/Echo.php @@ -65,7 +65,7 @@ $wgSpecialPages['Notifications'] = 'SpecialNotifications'; // Housekeeping hooks -$wgHooks['LoadExtensionSchemaUpdates'][] = 'EchoHooks::getSchemaUpdates'; +$wgHooks['LoadExtensionSchemaUpdates'][] = 'EchoHooks::onLoadExtensionSchemaUpdates'; $wgHooks['GetPreferences'][] = 'EchoHooks::getPreferences'; $wgHooks['PersonalUrls'][] = 'EchoHooks::onPersonalUrls'; $wgHooks['BeforePageDisplay'][] = 'EchoHooks::beforePageDisplay'; diff --git a/Hooks.php b/Hooks.php index 068fadf..19c3251 100755 --- a/Hooks.php +++ b/Hooks.php @@ -124,9 +124,13 @@ /** * @param $updater DatabaseUpdater object - * @return bool true in all cases */ - public static function getSchemaUpdates( $updater ) { + public static function onLoadExtensionSchemaUpdates( DatabaseUpdater $updater ) { + global $wgEchoCluster; + if ( $wgEchoCluster !== false ) { + // DatabaseUpdater does not support other databases, so skip + return; + } $dir = __DIR__; $baseSQLFile = "$dir/echo.sql"; $updater->addExtensionTable( 'echo_event', $baseSQLFile ); @@ -161,8 +165,6 @@ $updater->addExtensionField( 'echo_event', 'event_page_id', "$dir/db_patches/patch-add-echo_event-event_page_id.sql" ); $updater->addExtensionIndex( 'echo_event', 'echo_event_type', "$dir/db_patches/patch-alter-event_type-index.sql" ); $updater->addExtensionIndex( 'echo_notification', 'echo_user_timestamp', "$dir/db_patches/patch-alter-user_timestamp-index.sql" ); - - return true; } /** -- To view, visit https://gerrit.wikimedia.org/r/215255 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I488e4636f9499c468b870966614b0762c2ade8ea Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits