X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fsite%2FSiteExporter.php;h=01b838ef147e7ac9107d5626551e0fa6f5b30d62;hb=ff2dfbe9420b2ae8a942e1b6c3baa554d4a0a513;hp=62f6ca3cb266def2e26b260312c9d4cf4895dc58;hpb=2086cd118020f6388d7b6952ac2d9e2b55e6ef1f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/site/SiteExporter.php b/includes/site/SiteExporter.php index 62f6ca3cb2..01b838ef14 100644 --- a/includes/site/SiteExporter.php +++ b/includes/site/SiteExporter.php @@ -52,18 +52,18 @@ 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" ); + 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 ); } @@ -74,41 +74,41 @@ class SiteExporter { */ private function exportSite( Site $site ) { if ( $site->getType() !== Site::TYPE_UNKNOWN ) { - $siteAttr = array( 'type' => $site->getType() ); + $siteAttr = [ 'type' => $site->getType() ]; } else { $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', [ '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 - //@todo: export + // @todo: export + // @todo: export - fwrite( $this->sink, "\t" . XML::closeElement( 'site' ) . "\n" ); + fwrite( $this->sink, "\t" . Xml::closeElement( 'site' ) . "\n" ); } }