jenkins-bot has submitted this change and it was merged.

Change subject: Drop rebuildAllData maintenance script
......................................................................


Drop rebuildAllData maintenance script

This script was broken anyway (according to Daniel for a year now).
I found it because the hook code called methods that don't exist
any more. I'm not sure if it's ok to drop it. I could try fixing.
Is that worth our time?

Change-Id: Ib7a3908a12dba1570757e54ff6cdcddf27499d7e
---
M client/WikibaseClient.hooks.php
M client/WikibaseClient.php
D lib/maintenance/rebuildAllData.php
M repo/Wikibase.hooks.php
M repo/Wikibase.php
5 files changed, 0 insertions(+), 145 deletions(-)

Approvals:
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index 9c332c6..aec9563 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -19,7 +19,6 @@
 use Title;
 use UnexpectedValueException;
 use User;
-use Wikibase\Client\Changes\ChangeHandler;
 use Wikibase\Client\Hooks\BaseTemplateAfterPortletHandler;
 use Wikibase\Client\Hooks\BeforePageDisplayHandler;
 use Wikibase\Client\Hooks\ChangesPageWikibaseFilterHandler;
@@ -103,37 +102,6 @@
                        __METHOD__
                );
 
-               $reportMessage( "done!\n" );
-
-               return true;
-       }
-
-       /**
-        * Rebuilds all the data stored on the repository.
-        * This hook will probably be called manually when the
-        * rebuildAllData script is run on the client.
-        *
-        * @since 0.2
-        *
-        * @param callable $reportMessage // takes a string parameter and echos 
it
-        *
-        * @return bool
-        */
-       public static function onWikibaseRebuildData( $reportMessage ) {
-               $store = WikibaseClient::getDefaultInstance()->getStore();
-               $reportMessage( "Rebuilding all data in the " . get_class( 
$store )
-                       . " store on the client..." );
-               $store->rebuild();
-
-               $changesTable = new ChangesTable();
-               $changes = $changesTable->select(
-                       null,
-                       array(),
-                       array(),
-                       __METHOD__
-               );
-
-               ChangeHandler::singleton()->handleChanges( iterator_to_array( 
$changes ) );
                $reportMessage( "done!\n" );
 
                return true;
diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index 15ce72b..abf4be1 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -121,7 +121,6 @@
 
        // extension hooks
        $wgHooks['WikibaseDeleteData'][]                        = 
'\Wikibase\ClientHooks::onWikibaseDeleteData';
-       $wgHooks['WikibaseRebuildData'][]                       = 
'\Wikibase\ClientHooks::onWikibaseRebuildData';
 
        // api modules
        $wgAPIMetaModules['wikibase'] = 'Wikibase\ApiClientInfo';
diff --git a/lib/maintenance/rebuildAllData.php 
b/lib/maintenance/rebuildAllData.php
deleted file mode 100644
index 005ea61..0000000
--- a/lib/maintenance/rebuildAllData.php
+++ /dev/null
@@ -1,87 +0,0 @@
-<?php
-
-namespace Wikibase;
-
-$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' 
) : __DIR__ . '/../../../..';
-
-require_once $basePath . '/maintenance/Maintenance.php';
-
-/**
- * Maintenance script for rebuilding all secondary Wikibase data (ie indexes 
and caches).
- *
- * @since 0.1
- *
- * @licence GNU GPL v2+
- * @author Jeroen De Dauw < [email protected] >
- */
-class RebuildAllData extends \Maintenance {
-
-       public function __construct() {
-               $this->mDescription = 'Rebuild the Wikidata data';
-
-               parent::__construct();
-       }
-
-       public function execute() {
-               if ( !defined( 'WBL_VERSION' ) ) {
-                       $this->output( "You need to have WikibaseLib enabled in 
order to use this maintenance script!\n\n" );
-                       exit;
-               }
-
-               $quick = $_SERVER['argc'] > 1 && $_SERVER['argv'][1] == 
'--yes-im-sure-maybe';
-
-               if ( !$quick ) {
-                       echo "Are you really really sure you want to rebuild 
all the Wikibase data?? If so, type YES\n";
-
-                       if ( $this->readconsole() !== 'YES' ) {
-                               return;
-                       }
-               }
-
-               $report = function( $message ) {
-                       echo $message;
-               };
-
-               wfRunHooks( 'WikibaseRebuildData', array( $report ) );
-
-               $report( <<<EOT
-
-                        ......                             ..          ,,
-                 ..=~..                             ZD.   ....:=,.
-                 ..:++=..     .,.     .:        .....M....,=+++...
-                 ...=+++~......:~.....~= ..   ...~==.7.:+++++=.. .
-                  . :+++++~.. .,+=...,++...  ..~++=..:++++++~...
-                    .+++++++~..:++=..~++,.. .:++++~===+++++=.
-                    .~++++++++~:++++:=++=..~++++++++:=++++:..
-           ....     ..++++++++++++=+M7IM~+++++=+=+++8++++:.
-           .=:...... .,++++++++++:M:::::~D~~:M...I++M+++:.
-          ...,=+=,... .=++++++++++++?N ......M. .?++I++=..
-            ...:+++=,...+++++++++O.M..  .O= ,. +..++~+=.
-        .MD. ....+++++==~+++++++:...M,M,NMMMMM, ...~=+,..           ....
-     .=.$:::~.....+++++++++++++++M.7M.MMMMMMMMM.   Z+~.......      ..,==..
-     .M::::::M... .~+++++++++++++++.7MMMMMMMMMM.   M+,,~==+,.....~=++=.
-     .M:::::::?..:=+++++++++++++++=, .:MMMMMMMM  ..8+++++:...,==+++=...
-       M~::::::M...=+++++++++++++++=,...MMMMMMN ..?7=+++,.~+++++=:...
-       .M:::~~~8....,++++++++++++++=M   MMMMMMM...77N+++++++++=,..
-       ...:+=NOM. ....~+++++++++==I++Z  .?MMMN  .Z7I7=++++++=,..
-            ..?OZ~++++++++++++~N==++++?,.......=O77I7O+++++~......
-        ......,~OO?+++++++++I++++++++++DIZ8DDZ7777777O++++,..........
-       ..~++++=::8ON=++++=N=+++++++++++=77777777777777~+++++++++++++++=:..
-          ,+++++++DZ8=+8=+++++++++++++++D7I77777777777N+++++++++++++++++:.
-          .~+++++++:8O?++++++++++++++++++II777777777777=++++++++++=:......
-          ..=+++++++=DON=++++++++++++++++D77777777777I7=++++++~,..
-          ...=++++++++8O8=+++++++++++++++OI777777777777=++=:......
-            ..:++++++++~OO??++++++++++++~?I777777777777=++=,.
-......... 
.....,++++++++~8ZN++++++++++++~77777777777777=++++:...................
-
-                                  REBUILD
-                             ALL OF THE DATAS!
-
-EOT
-               );
-       }
-
-}
-
-$maintClass = 'Wikibase\RebuildAllData';
-require_once( RUN_MAINTENANCE_IF_MAIN );
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index d3be526..1ef35f7 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -530,30 +530,6 @@
        }
 
        /**
-        * Handles a rebuild request by rebuilding all secondary storage of the 
repository.
-        * @see https://www.mediawiki.org/wiki/Manual:Hooks/WikibaseRebuildData
-        *
-        * @since 0.1
-        *
-        * @param callable $reportMessage Takes a string parameter and echos it.
-        *
-        * @return bool
-        */
-       public static function onWikibaseRebuildData( $reportMessage ) {
-               $store = WikibaseRepo::getDefaultInstance()->getStore();
-
-               $reportMessage(
-                       'Starting rebuild of the Wikibase repository ' . 
get_class( $store ) . ' store...'
-               );
-
-               $store->rebuild();
-
-               $reportMessage( "done!\n" );
-
-               return true;
-       }
-
-       /**
         * Reorder the groups for the special pages
         *
         * @since 0.4
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index 0aeda2e..3523430 100644
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -198,7 +198,6 @@
        $wgHooks['FormatAutocomments'][]                                        
= array( 'Wikibase\RepoHooks::onFormat', array( CONTENT_MODEL_WIKIBASE_ITEM, 
"wikibase-item" ) );
        $wgHooks['FormatAutocomments'][]                                        
= array( 'Wikibase\RepoHooks::onFormat', array( 
CONTENT_MODEL_WIKIBASE_PROPERTY, "wikibase-property" ) );
        $wgHooks['PageHistoryLineEnding'][]                                     
= 'Wikibase\RepoHooks::onPageHistoryLineEnding';
-       $wgHooks['WikibaseRebuildData'][]                                       
= 'Wikibase\RepoHooks::onWikibaseRebuildData';
        $wgHooks['WikibaseDeleteData'][]                                        
= 'Wikibase\RepoHooks::onWikibaseDeleteData';
        $wgHooks['ApiCheckCanExecute'][]                                        
= 'Wikibase\RepoHooks::onApiCheckCanExecute';
        $wgHooks['SetupAfterCache'][]                                           
= 'Wikibase\RepoHooks::onSetupAfterCache';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib7a3908a12dba1570757e54ff6cdcddf27499d7e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to