diff options
Diffstat (limited to 'includes/site')
-rw-r--r-- | includes/site/CachingSiteStore.php | 6 | ||||
-rw-r--r-- | includes/site/DBSiteStore.php | 6 | ||||
-rw-r--r-- | includes/site/SiteExporter.php | 20 | ||||
-rw-r--r-- | includes/site/SiteSQLStore.php | 2 |
4 files changed, 21 insertions, 13 deletions
diff --git a/includes/site/CachingSiteStore.php b/includes/site/CachingSiteStore.php index 9243f12b..077dbc0e 100644 --- a/includes/site/CachingSiteStore.php +++ b/includes/site/CachingSiteStore.php @@ -168,9 +168,11 @@ class CachingSiteStore implements SiteStore { } /** - * Purges the internal and external cache of the site list, forcing the list + * Purges the internal and external cache of the site list, forcing the list. * of sites to be reloaded. * + * Only use this for testing, as APC is typically used and is per-server + * * @since 1.25 */ public function reset() { @@ -182,6 +184,8 @@ class CachingSiteStore implements SiteStore { /** * Clears the list of sites stored. * + * Only use this for testing, as APC is typically used and is per-server. + * * @see SiteStore::clear() * * @return bool Success diff --git a/includes/site/DBSiteStore.php b/includes/site/DBSiteStore.php index f167584e..1193bd65 100644 --- a/includes/site/DBSiteStore.php +++ b/includes/site/DBSiteStore.php @@ -153,7 +153,11 @@ class DBSiteStore implements SiteStore { protected function loadSites() { $this->sites = new SiteList(); - foreach ( $this->sitesTable->select() as $siteRow ) { + $siteRows = $this->sitesTable->select( null, array(), array( + 'ORDER BY' => 'site_global_key' + ) ); + + foreach ( $siteRows as $siteRow ) { $this->sites[] = $this->siteFromRow( $siteRow ); } diff --git a/includes/site/SiteExporter.php b/includes/site/SiteExporter.php index 62f6ca3c..169c0d87 100644 --- a/includes/site/SiteExporter.php +++ b/includes/site/SiteExporter.php @@ -57,13 +57,13 @@ class SiteExporter { 'xmlns' => 'http://www.mediawiki.org/xml/sitelist-1.0/', ); - fwrite( $this->sink, XML::openElement( 'sites', $attributes ) . "\n" ); + fwrite( $this->sink, Xml::openElement( 'sites', $attributes ) . "\n" ); foreach ( $sites as $site ) { $this->exportSite( $site ); } - fwrite( $this->sink, XML::closeElement( 'sites' ) . "\n" ); + fwrite( $this->sink, Xml::closeElement( 'sites' ) . "\n" ); fflush( $this->sink ); } @@ -79,36 +79,36 @@ class SiteExporter { $siteAttr = null; } - fwrite( $this->sink, "\t" . XML::openElement( 'site', $siteAttr ) . "\n" ); + fwrite( $this->sink, "\t" . Xml::openElement( 'site', $siteAttr ) . "\n" ); - fwrite( $this->sink, "\t\t" . XML::element( 'globalid', null, $site->getGlobalId() ) . "\n" ); + fwrite( $this->sink, "\t\t" . Xml::element( 'globalid', null, $site->getGlobalId() ) . "\n" ); if ( $site->getGroup() !== Site::GROUP_NONE ) { - fwrite( $this->sink, "\t\t" . XML::element( 'group', null, $site->getGroup() ) . "\n" ); + fwrite( $this->sink, "\t\t" . Xml::element( 'group', null, $site->getGroup() ) . "\n" ); } if ( $site->getSource() !== Site::SOURCE_LOCAL ) { - fwrite( $this->sink, "\t\t" . XML::element( 'source', null, $site->getSource() ) . "\n" ); + fwrite( $this->sink, "\t\t" . Xml::element( 'source', null, $site->getSource() ) . "\n" ); } if ( $site->shouldForward() ) { - fwrite( $this->sink, "\t\t" . XML::element( 'forward', null, '' ) . "\n" ); + fwrite( $this->sink, "\t\t" . Xml::element( 'forward', null, '' ) . "\n" ); } foreach ( $site->getAllPaths() as $type => $path ) { - fwrite( $this->sink, "\t\t" . XML::element( 'path', array( 'type' => $type ), $path ) . "\n" ); + fwrite( $this->sink, "\t\t" . Xml::element( 'path', array( 'type' => $type ), $path ) . "\n" ); } foreach ( $site->getLocalIds() as $type => $ids ) { foreach ( $ids as $id ) { - fwrite( $this->sink, "\t\t" . XML::element( 'localid', array( 'type' => $type ), $id ) . "\n" ); + fwrite( $this->sink, "\t\t" . Xml::element( 'localid', array( 'type' => $type ), $id ) . "\n" ); } } //@todo: export <data> //@todo: export <config> - fwrite( $this->sink, "\t" . XML::closeElement( 'site' ) . "\n" ); + fwrite( $this->sink, "\t" . Xml::closeElement( 'site' ) . "\n" ); } } diff --git a/includes/site/SiteSQLStore.php b/includes/site/SiteSQLStore.php index d77f07be..e3230fff 100644 --- a/includes/site/SiteSQLStore.php +++ b/includes/site/SiteSQLStore.php @@ -41,7 +41,7 @@ class SiteSQLStore extends CachingSiteStore { */ public static function newInstance( ORMTable $sitesTable = null, BagOStuff $cache = null ) { if ( $cache === null ) { - $cache = wfGetMainCache(); + $cache = wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING ); } $siteStore = new DBSiteStore(); |