Aude has uploaded a new change for review. https://gerrit.wikimedia.org/r/119888
Change subject: Remove WBC_VERSION check and namespace from populateInterwiki.php ...................................................................... Remove WBC_VERSION check and namespace from populateInterwiki.php This script has been the among the most useful thing in all of wikibase! It has no reason at all to actually require Wikibase and should ideally be moved into core. This is one step towards moving this to core. Change-Id: Iae2fa32fdbb6ebd743d0ae0538942556255ecbd6 --- M client/maintenance/populateInterwiki.php 1 file changed, 9 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/88/119888/1 diff --git a/client/maintenance/populateInterwiki.php b/client/maintenance/populateInterwiki.php index 497ec5e..2ac2e5a 100644 --- a/client/maintenance/populateInterwiki.php +++ b/client/maintenance/populateInterwiki.php @@ -1,8 +1,5 @@ <?php -namespace Wikibase; -use Http, FormatJSON, Maintenance, Exception; - /** * Maintenance script that populates the interwiki table with list of sites * as exists on Wikipedia, so interwiki links render properly. @@ -12,7 +9,8 @@ * @licence GNU GPL v2+ * @author Katie Filbert < [email protected] > */ -$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) : __DIR__ . '/../../../..'; +$basePath = getenv( 'MW_INSTALL_PATH' ) !== false ? getenv( 'MW_INSTALL_PATH' ) + : __DIR__ . '/../../../..'; require_once $basePath . '/maintenance/Maintenance.php'; @@ -36,21 +34,20 @@ database table. TEXT; - $this->addOption( 'source', 'Source wiki for interwiki table, such as https://en.wikipedia.org/w/api.php', false, true ); - $this->addOption( 'force', 'Run regardless of whether the database says it has been run already.' ); + $this->addOption( 'source', 'Source wiki for interwiki table, such as ' + . 'https://en.wikipedia.org/w/api.php', false, true ); + $this->addOption( 'force', 'Run regardless of whether the database says it has ' + . 'been run already.' ); parent::__construct(); } public function execute() { - if ( !defined( 'WBC_VERSION' ) ) { - $this->output( "You need to have WikibaseClient enabled in order to use this maintenance script!\n\n" ); - exit; - } - $force = $this->getOption( 'force', false ); $this->source = $this->getOption( 'source', 'https://en.wikipedia.org/w/api.php' ); + $data = $this->fetchLinks(); + if ( $data === false ) { $this->error( "Error during fetching data." ); } else { @@ -135,5 +132,5 @@ } } -$maintClass = 'Wikibase\PopulateInterwiki'; +$maintClass = 'PopulateInterwiki'; require_once( RUN_MAINTENANCE_IF_MAIN ); -- To view, visit https://gerrit.wikimedia.org/r/119888 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iae2fa32fdbb6ebd743d0ae0538942556255ecbd6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Aude <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
