Add RELEASE-NOTES for I4678250331a48db4d50d1fc6c489c991a4dee920
[lhc/web/wiklou.git] / maintenance / generateSitemap.php
index f568ddb..ff3e2fc 100644 (file)
@@ -177,7 +177,7 @@ class GenerateSitemap extends Maintenance {
        public function execute() {
                $this->setNamespacePriorities();
                $this->url_limit = 50000;
-               $this->size_limit = pow( 2, 20 ) * 10;
+               $this->size_limit = ( 2 ** 20 ) * 10;
 
                # Create directory if needed
                $fspath = $this->getOption( 'fspath', getcwd() );
@@ -276,9 +276,7 @@ class GenerateSitemap extends Maintenance {
         * @return string
         */
        function priority( $namespace ) {
-               return isset( $this->priorities[$namespace] )
-                       ? $this->priorities[$namespace]
-                       : $this->guessPriority( $namespace );
+               return $this->priorities[$namespace] ?? $this->guessPriority( $namespace );
        }
 
        /**
@@ -484,8 +482,7 @@ class GenerateSitemap extends Maintenance {
         * @return string
         */
        function indexEntry( $filename ) {
-               return
-                       "\t<sitemap>\n" .
+               return "\t<sitemap>\n" .
                        "\t\t<loc>{$this->urlpath}$filename</loc>\n" .
                        "\t\t<lastmod>{$this->timestamp}</lastmod>\n" .
                        "\t</sitemap>\n";
@@ -518,8 +515,7 @@ class GenerateSitemap extends Maintenance {
         * @return string
         */
        function fileEntry( $url, $date, $priority ) {
-               return
-                       "\t<url>\n" .
+               return "\t<url>\n" .
                        // T36666: $url may contain bad characters such as ampersands.
                        "\t\t<loc>" . htmlspecialchars( $url ) . "</loc>\n" .
                        "\t\t<lastmod>$date</lastmod>\n" .
@@ -543,7 +539,7 @@ class GenerateSitemap extends Maintenance {
         */
        function generateLimit( $namespace ) {
                // T19961: make a title with the longest possible URL in this namespace
-               $title = Title::makeTitle( $namespace, str_repeat( "\xf0\xa8\xae\x81", 63 ) . "\xe5\x96\x83" );
+               $title = Title::makeTitle( $namespace, str_repeat( "\u{28B81}", 63 ) . "\u{5583}" );
 
                $this->limit = [
                        strlen( $this->openFile() ),
@@ -557,5 +553,5 @@ class GenerateSitemap extends Maintenance {
        }
 }
 
-$maintClass = "GenerateSitemap";
+$maintClass = GenerateSitemap::class;
 require_once RUN_MAINTENANCE_IF_MAIN;