MediaWiki master
GenerateSitemap Class Reference

Maintenance script that generates a sitemap for the site. More...

Inherits Maintenance.

Collaboration diagram for GenerateSitemap:

Public Member Functions

 __construct ()
 
 execute ()
 Execute.
 
 main ()
 Main loop.
 

Public Attributes

bool $compress
 Whether or not to use compression.
 
IDatabase $dbr
 A database replica DB object.
 
resource false $file
 A resource pointing to a sitemap file.
 
resource $findex
 A resource pointing to the sitemap index file.
 
string $fspath
 The path to prepend to the filename.
 
array $limit = []
 The number of entries to save in each sitemap file.
 
array $namespaces = []
 A one-dimensional array of namespaces in the wiki.
 
array $priorities = []
 Key => value entries of namespaces and their priorities.
 
int $size_limit
 The maximum size of a sitemap file.
 
bool $skipRedirects
 Whether or not to include redirection pages.
 
string $timestamp
 When this sitemap batch was generated.
 
int $url_limit
 The maximum amount of urls in a sitemap file.
 
string $urlpath
 The URL path to prepend to filenames in the index; should resolve to the same directory as $fspath.
 

Detailed Description

Maintenance script that generates a sitemap for the site.

Definition at line 44 of file generateSitemap.php.

Constructor & Destructor Documentation

◆ __construct()

GenerateSitemap::__construct ( )

Definition at line 151 of file generateSitemap.php.

Member Function Documentation

◆ execute()

GenerateSitemap::execute ( )

Execute.

Definition at line 191 of file generateSitemap.php.

References $fspath, main(), wfMkdirParents(), wfTimestamp(), and wfTimestampNow().

◆ main()

GenerateSitemap::main ( )

Main loop.

Definition at line 335 of file generateSitemap.php.

References PROTO_CANONICAL, and wfTimestamp().

Referenced by execute().

Member Data Documentation

◆ $compress

bool GenerateSitemap::$compress

Whether or not to use compression.

Definition at line 86 of file generateSitemap.php.

◆ $dbr

IDatabase GenerateSitemap::$dbr

A database replica DB object.

Definition at line 128 of file generateSitemap.php.

◆ $file

resource false GenerateSitemap::$file

A resource pointing to a sitemap file.

Definition at line 142 of file generateSitemap.php.

◆ $findex

resource GenerateSitemap::$findex

A resource pointing to the sitemap index file.

Definition at line 135 of file generateSitemap.php.

◆ $fspath

string GenerateSitemap::$fspath

The path to prepend to the filename.

Definition at line 71 of file generateSitemap.php.

Referenced by execute().

◆ $limit

array GenerateSitemap::$limit = []

The number of entries to save in each sitemap file.

Definition at line 100 of file generateSitemap.php.

◆ $namespaces

array GenerateSitemap::$namespaces = []

A one-dimensional array of namespaces in the wiki.

Definition at line 114 of file generateSitemap.php.

◆ $priorities

array GenerateSitemap::$priorities = []

Key => value entries of namespaces and their priorities.

Definition at line 107 of file generateSitemap.php.

◆ $size_limit

int GenerateSitemap::$size_limit

The maximum size of a sitemap file.

http://www.sitemaps.org/faq.php#faq_sitemap_size

Definition at line 64 of file generateSitemap.php.

◆ $skipRedirects

bool GenerateSitemap::$skipRedirects

Whether or not to include redirection pages.

Definition at line 93 of file generateSitemap.php.

◆ $timestamp

string GenerateSitemap::$timestamp

When this sitemap batch was generated.

Definition at line 121 of file generateSitemap.php.

◆ $url_limit

int GenerateSitemap::$url_limit

The maximum amount of urls in a sitemap file.

http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd

Definition at line 55 of file generateSitemap.php.

◆ $urlpath

string GenerateSitemap::$urlpath

The URL path to prepend to filenames in the index; should resolve to the same directory as $fspath.

Definition at line 79 of file generateSitemap.php.


The documentation for this class was generated from the following file: