Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/268586
Change subject: Remove addToSites.php script
......................................................................
Remove addToSites.php script
This was needed at one point but don't think
we need it again and it's not maintained.
Change-Id: Id31b16b9522a689e9a8fcf2e01925c49dedbc222
---
D addToSites.php
1 file changed, 0 insertions(+), 86 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMaintenance
refs/changes/86/268586/1
diff --git a/addToSites.php b/addToSites.php
deleted file mode 100644
index 83b9277..0000000
--- a/addToSites.php
+++ /dev/null
@@ -1,86 +0,0 @@
-<?php
-
-require_once __DIR__ . '/WikimediaMaintenance.php';
-
-/**
- * Add wikidata and testwikidata to sites table
- *
- * @todo make this generic for adding any site
- * and integrate with addWiki!
- */
-class AddToSites extends Maintenance {
-
- function __construct() {
- parent::__construct();
- $this->mDescription = 'Adds Wikidata to the sites table';
- }
-
- function execute() {
- $siteStore = SiteSQLStore::newInstance();
-
- $sites = array();
-
- $sites[] = $this->getNewSite(
- 'wikidatawiki', 'wikidata', 'en',
'http://www.wikidata.org'
- );
-
- $sites[] = $this->getNewSite(
- 'testwikidatawiki', 'testwikidata', 'en',
'http://test.wikidata.org'
- );
-
- foreach( $sites as $site ) {
- $globalId = $site->getGlobalId();
- $this->clearSiteIfExists( $globalId );
- $siteStore->saveSite( $site );
-
- $this->output( "added $globalId to sites table\n" );
- }
-
- // clear caches
- $siteStore->reset();
-
- $this->output( "done\n" );
- }
-
- function clearSiteIfExists( $globalId ) {
- $dbw = wfGetDB( DB_MASTER );
-
- $site = $dbw->selectRow(
- 'sites',
- array( 'site_global_key' ),
- array( 'site_global_key' => $globalId ),
- __METHOD__
- );
-
- if ( $site ) {
- $dbw->delete(
- 'sites',
- array( 'site_global_key' => $globalId ),
- __METHOD__
- );
-
- $this->output( "cleared $globalId from sites table\n" );
- }
- }
-
- function getNewSite( $globalId, $group, $langCode, $baseUrl ) {
- $site = MediaWikiSite::newFromGlobalId( $globalId );
- $site->setGroup( $group );
- $site->setLanguageCode( $langCode );
-
- $extra = array( 'paths' =>
- array(
- 'file_path' => "$baseUrl/w/$1",
- 'page_path' => "$baseUrl/wiki/$1"
- )
- );
-
- $site->setExtraData( $extra );
-
- return $site;
- }
-
-}
-
-$maintClass = 'AddToSites';
-require_once RUN_MAINTENANCE_IF_MAIN;
--
To view, visit https://gerrit.wikimedia.org/r/268586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id31b16b9522a689e9a8fcf2e01925c49dedbc222
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMaintenance
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits