summaryrefslogtreecommitdiff
path: root/maintenance/generateSitemap.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /maintenance/generateSitemap.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'maintenance/generateSitemap.php')
-rw-r--r--maintenance/generateSitemap.php23
1 files changed, 8 insertions, 15 deletions
diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php
index 1930a22a..12711ea3 100644
--- a/maintenance/generateSitemap.php
+++ b/maintenance/generateSitemap.php
@@ -181,7 +181,14 @@ class GenerateSitemap extends Maintenance {
$this->setNamespacePriorities();
$this->url_limit = 50000;
$this->size_limit = pow( 2, 20 ) * 10;
- $this->fspath = self::init_path( $this->getOption( 'fspath', getcwd() ) );
+
+ # Create directory if needed
+ $fspath = $this->getOption( 'fspath', getcwd() );
+ if ( !wfMkdirParents( $fspath, null, __METHOD__ ) ) {
+ $this->error( "Can not create directory $fspath.", 1 );
+ }
+
+ $this->fspath = realpath( $fspath ) . DIRECTORY_SEPARATOR;
$this->urlpath = $this->getOption( 'urlpath', "" );
if ( $this->urlpath !== "" && substr( $this->urlpath, -1 ) !== '/' ) {
$this->urlpath .= '/';
@@ -239,20 +246,6 @@ class GenerateSitemap extends Maintenance {
}
/**
- * Create directory if it does not exist and return pathname with a trailing slash
- * @param string $fspath
- * @return null|string
- */
- private static function init_path( $fspath ) {
- # Create directory if needed
- if ( $fspath && !is_dir( $fspath ) ) {
- wfMkdirParents( $fspath, null, __METHOD__ ) or die( "Can not create directory $fspath.\n" );
- }
-
- return realpath( $fspath ) . DIRECTORY_SEPARATOR;
- }
-
- /**
* Generate a one-dimensional array of existing namespaces
*/
function generateNamespaces() {