jenkins-bot has submitted this change and it was merged.
Change subject: Delete deleteAllData maintenance and WikibaseDeleteData hooks
......................................................................
Delete deleteAllData maintenance and WikibaseDeleteData hooks
Not 100% sure it is no longer used, though it certainly is no longer
deleting ALL data.
Change-Id: I08d3e2407856f9d2bc5764c76af801f5c2e489a6
---
M client/WikibaseClient.hooks.php
M client/WikibaseClient.php
D lib/maintenance/deleteAllData.php
M repo/Wikibase.hooks.php
M repo/Wikibase.php
5 files changed, 0 insertions(+), 176 deletions(-)
Approvals:
Thiemo Mättig (WMDE): Looks good to me, but someone else must approve
Addshore: Looks good to me, approved
jenkins-bot: Verified
diff --git a/client/WikibaseClient.hooks.php b/client/WikibaseClient.hooks.php
index e54758c..ca3e3b9 100644
--- a/client/WikibaseClient.hooks.php
+++ b/client/WikibaseClient.hooks.php
@@ -77,35 +77,6 @@
}
/**
- * Deletes all the data stored on the repository.
- *
- * @since 0.2
- *
- * @param callable $reportMessage // takes a string param and echos it
- *
- * @return bool
- */
- public static function onWikibaseDeleteData( $reportMessage ) {
- $store = WikibaseClient::getDefaultInstance()->getStore();
-
- $reportMessage( "Deleting data from the " . get_class( $store )
. " store..." );
-
- $store->clear();
-
- // @todo filter by something better than RC_EXTERNAL, in case
something else uses that someday
- $dbw = wfGetDB( DB_MASTER );
- $dbw->delete(
- 'recentchanges',
- array( 'rc_type' => RC_EXTERNAL ),
- __METHOD__
- );
-
- $reportMessage( "done!\n" );
-
- return true;
- }
-
- /**
* External library for Scribunto
*
* @since 0.4
diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php
index 699a5f4..cc3fd52 100644
--- a/client/WikibaseClient.php
+++ b/client/WikibaseClient.php
@@ -121,9 +121,6 @@
// update hooks
$wgHooks['LoadExtensionSchemaUpdates'][] =
'\Wikibase\Client\Usage\Sql\SqlUsageTrackerSchemaUpdater::onSchemaUpdate';
- // extension hooks
- $wgHooks['WikibaseDeleteData'][] =
'\Wikibase\ClientHooks::onWikibaseDeleteData';
-
// job classes
$wgJobClasses['wikibase-addUsagesForPage'] =
'Wikibase\Client\Store\AddUsagesForPageJob';
diff --git a/lib/maintenance/deleteAllData.php
b/lib/maintenance/deleteAllData.php
deleted file mode 100644
index a6a9767..0000000
--- a/lib/maintenance/deleteAllData.php
+++ /dev/null
@@ -1,90 +0,0 @@
-<?php
-
-namespace Wikibase;
-
-use Hooks;
-
-$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH'
) : __DIR__ . '/../../../..';
-
-require_once $basePath . '/maintenance/Maintenance.php';
-
-/**
- * Maintenance script for deleting all Wikibase data.
- *
- * @since 0.1
- *
- * @licence GNU GPL v2+
- * @author Jeroen De Dauw < [email protected] >
- */
-class DeleteAllData extends \Maintenance {
-
- public function __construct() {
- $this->mDescription = 'Delete 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 delete all
the Wikibase data?? If so, type DELETE\n";
-
- if ( $this->readconsole() !== 'DELETE' ) {
- return;
- }
- }
-
- $report = function( $message ) {
- echo $message;
- };
-
- Hooks::run( 'WikibaseDeleteData', array( $report ) );
-
- $report( <<<EOT
-Some tasty bits there... omnomnom...
-
- ...... .. ,,
- ..=~.. 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=++++:...................
-
- DELETED
- ALL OF THE DATAS!
-
-EOT
- );
- }
-
-}
-
-$maintClass = 'Wikibase\DeleteAllData';
-require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/repo/Wikibase.hooks.php b/repo/Wikibase.hooks.php
index 12bcb9d..bc5e7d9 100644
--- a/repo/Wikibase.hooks.php
+++ b/repo/Wikibase.hooks.php
@@ -540,59 +540,6 @@
}
/**
- * Deletes all the data stored on the repository.
- * @see https://www.mediawiki.org/wiki/Manual:Hooks/WikibaseDeleteData
- *
- * @since 0.1
- *
- * @param callable $reportMessage // takes a string param and echos it
- *
- * @return bool
- */
- public static function onWikibaseDeleteData( $reportMessage ) {
- $entityNamespaceLookup =
WikibaseRepo::getDefaultInstance()->getEntityNamespaceLookup();
-
- $reportMessage( 'Deleting data from changes table...' );
-
- $dbw = wfGetDB( DB_MASTER );
- $dbw->delete( 'wb_changes', '*', __METHOD__ );
- $dbw->delete( 'wb_changes_dispatch', '*', __METHOD__ );
-
- $reportMessage( "done!\n" );
-
- $reportMessage( 'Deleting revisions from Data NS...' );
-
- $namespaceList = $dbw->makeList(
$entityNamespaceLookup->getEntityNamespaces(), LIST_COMMA );
-
- $dbw->deleteJoin(
- 'revision', 'page',
- 'rev_page', 'page_id',
- array( 'page_namespace IN ( ' . $namespaceList . ')' )
- );
-
- $reportMessage( "done!\n" );
-
- $reportMessage( 'Deleting pages from Data NS...' );
-
- $dbw->delete(
- 'page',
- array( 'page_namespace IN ( ' . $namespaceList . ')' )
- );
-
- $reportMessage( "done!\n" );
-
- $store = WikibaseRepo::getDefaultInstance()->getStore();
-
- $reportMessage( 'Deleting data from the ' . get_class( $store )
. ' store...' );
-
- $store->clear();
-
- $reportMessage( "done!\n" );
-
- return true;
- }
-
- /**
* Used to append a css class to the body, so the page can be
identified as Wikibase item page.
* @see
http://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBodyAttributes
*
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index f7fc79d..3f77ae8 100644
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -243,7 +243,6 @@
array( CONTENT_MODEL_WIKIBASE_PROPERTY, 'wikibase-property' )
);
$wgHooks['PageHistoryLineEnding'][]
= 'Wikibase\RepoHooks::onPageHistoryLineEnding';
- $wgHooks['WikibaseDeleteData'][]
= 'Wikibase\RepoHooks::onWikibaseDeleteData';
$wgHooks['ApiCheckCanExecute'][]
= 'Wikibase\RepoHooks::onApiCheckCanExecute';
$wgHooks['SetupAfterCache'][]
= 'Wikibase\RepoHooks::onSetupAfterCache';
$wgHooks['ShowSearchHit'][]
= 'Wikibase\RepoHooks::onShowSearchHit';
--
To view, visit https://gerrit.wikimedia.org/r/229321
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I08d3e2407856f9d2bc5764c76af801f5c2e489a6
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits