Merge "Remove unused private var and fix phpdoc"
[lhc/web/wiklou.git] / maintenance / generateSitemap.php
index b5681c1..1930a22 100644 (file)
@@ -244,9 +244,6 @@ class GenerateSitemap extends Maintenance {
         * @return null|string
         */
        private static function init_path( $fspath ) {
-               if ( !isset( $fspath ) ) {
-                       return null;
-               }
                # Create directory if needed
                if ( $fspath && !is_dir( $fspath ) ) {
                        wfMkdirParents( $fspath, null, __METHOD__ ) or die( "Can not create directory $fspath.\n" );
@@ -263,6 +260,7 @@ class GenerateSitemap extends Maintenance {
                global $wgSitemapNamespaces;
                if ( is_array( $wgSitemapNamespaces ) ) {
                        $this->namespaces = $wgSitemapNamespaces;
+
                        return;
                }
 
@@ -343,7 +341,7 @@ class GenerateSitemap extends Maintenance {
 
                        $fns = $wgContLang->getFormattedNsText( $namespace );
                        $this->output( "$namespace ($fns)\n" );
-                       $skippedRedirects = 0;  // Number of redirects skipped for that namespace
+                       $skippedRedirects = 0; // Number of redirects skipped for that namespace
                        foreach ( $res as $row ) {
                                if ( $this->skipRedirects && $row->page_is_redirect ) {
                                        $skippedRedirects++;
@@ -415,6 +413,7 @@ class GenerateSitemap extends Maintenance {
                        throw new MWException( __METHOD__
                                . " error opening file $file with flags $flags. Check permissions?" );
                }
+
                return $resource;
        }
 
@@ -457,6 +456,7 @@ class GenerateSitemap extends Maintenance {
         */
        function sitemapFilename( $namespace, $count ) {
                $ext = $this->compress ? '.gz' : '';
+
                return "sitemap-{$this->identifier}-NS_$namespace-$count.xml$ext";
        }