MediaWiki  1.23.8
TestSites.php
Go to the documentation of this file.
1 <?php
2 
32 class TestSites {
33 
39  public static function getSites() {
40  $sites = array();
41 
42  $site = new Site();
43  $site->setGlobalId( 'foobar' );
44  $sites[] = $site;
45 
46  $site = new MediaWikiSite();
47  $site->setGlobalId( 'enwiktionary' );
48  $site->setGroup( 'wiktionary' );
49  $site->setLanguageCode( 'en' );
50  $site->addNavigationId( 'enwiktionary' );
51  $site->setPath( MediaWikiSite::PATH_PAGE, "https://en.wiktionary.org/wiki/$1" );
52  $site->setPath( MediaWikiSite::PATH_FILE, "https://en.wiktionary.org/w/$1" );
53  $sites[] = $site;
54 
55  $site = new MediaWikiSite();
56  $site->setGlobalId( 'dewiktionary' );
57  $site->setGroup( 'wiktionary' );
58  $site->setLanguageCode( 'de' );
59  $site->addInterwikiId( 'dewiktionary' );
60  $site->addInterwikiId( 'wiktionaryde' );
61  $site->setPath( MediaWikiSite::PATH_PAGE, "https://de.wiktionary.org/wiki/$1" );
62  $site->setPath( MediaWikiSite::PATH_FILE, "https://de.wiktionary.org/w/$1" );
63  $sites[] = $site;
64 
65  $site = new Site();
66  $site->setGlobalId( 'spam' );
67  $site->setGroup( 'spam' );
68  $site->setLanguageCode( 'en' );
69  $site->addNavigationId( 'spam' );
70  $site->addNavigationId( 'spamz' );
71  $site->addInterwikiId( 'spamzz' );
72  $site->setLinkPath( "http://spamzz.test/testing/" );
73  $sites[] = $site;
74 
75  foreach ( array( 'en', 'de', 'nl', 'sv', 'sr', 'no', 'nn' ) as $langCode ) {
76  $site = new MediaWikiSite();
77  $site->setGlobalId( $langCode . 'wiki' );
78  $site->setGroup( 'wikipedia' );
79  $site->setLanguageCode( $langCode );
80  $site->addInterwikiId( $langCode );
81  $site->addNavigationId( $langCode );
82  $site->setPath( MediaWikiSite::PATH_PAGE, "https://$langCode.wikipedia.org/wiki/$1" );
83  $site->setPath( MediaWikiSite::PATH_FILE, "https://$langCode.wikipedia.org/w/$1" );
84  $sites[] = $site;
85  }
86 
87  return $sites;
88  }
89 
95  public static function insertIntoDb() {
96  $sitesTable = SiteSQLStore::newInstance();
97  $sitesTable->clear();
98  $sitesTable->saveSites( TestSites::getSites() );
99  }
100 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
TestSites
Definition: TestSites.php:32
TestSites\getSites
static getSites()
Definition: TestSites.php:39
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
MediaWikiSite\PATH_FILE
const PATH_FILE
Definition: MediaWikiSite.php:37
Site
Definition: Site.php:29
MediaWikiSite\PATH_PAGE
const PATH_PAGE
Definition: MediaWikiSite.php:38
SiteSQLStore\newInstance
static newInstance(ORMTable $sitesTable=null)
Definition: SiteSQLStore.php:58
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
MediaWikiSite
Class representing a MediaWiki site.
Definition: MediaWikiSite.php:35
TestSites\insertIntoDb
static insertIntoDb()
Inserts sites into the database for the unit tests that need them.
Definition: TestSites.php:95