* @file
* @ingroup Site
*
- * @license GNU GPL v2+
+ * @license GPL-2.0-or-later
* @author Daniel Kinzler
*/
class SiteExporter {
* @param Site[]|SiteList $sites
*/
public function exportSites( $sites ) {
- $attributes = array(
+ $attributes = [
'version' => '1.0',
'xmlns' => 'http://www.mediawiki.org/xml/sitelist-1.0/',
- );
+ ];
fwrite( $this->sink, Xml::openElement( 'sites', $attributes ) . "\n" );
*/
private function exportSite( Site $site ) {
if ( $site->getType() !== Site::TYPE_UNKNOWN ) {
- $siteAttr = array( 'type' => $site->getType() );
+ $siteAttr = [ 'type' => $site->getType() ];
} else {
$siteAttr = null;
}
}
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', [ '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', [ 'type' => $type ], $id ) . "\n" );
}
}
- //@todo: export <data>
- //@todo: export <config>
+ // @todo: export <data>
+ // @todo: export <config>
fwrite( $this->sink, "\t" . Xml::closeElement( 'site' ) . "\n" );
}