MediaWiki
REL1_24
|
Maintenance script that generates a sitemap for the site. More...
Public Member Functions | |
__construct () | |
Constructor. | |
close (&$handle) | |
gzclose() / fclose() wrapper | |
closeFile () | |
Return the XML required to close sitemap file. | |
closeIndex () | |
Return the XML required to close a sitemap index file. | |
execute () | |
Execute. | |
fileEntry ($url, $date, $priority) | |
Return the XML for a single sitemap entry. | |
generateLimit ($namespace) | |
Populate $this->limit. | |
generateNamespaces () | |
Generate a one-dimensional array of existing namespaces. | |
getPageRes ($namespace) | |
Return a database resolution of all the pages in a given namespace. | |
guessPriority ($namespace) | |
If the namespace isn't listed on the priority list return the default priority for the namespace, varies depending on whether it's a talkpage or not. | |
indexEntry ($filename) | |
Return the XML for a single sitemap indexfile entry. | |
main () | |
Main loop. | |
open ($file, $flags) | |
gzopen() / fopen() wrapper | |
openFile () | |
Return the XML required to open a sitemap file. | |
openIndex () | |
Return the XML required to open a sitemap index file. | |
priority ($namespace) | |
Get the priority of a given namespace. | |
sitemapFilename ($namespace, $count) | |
Get a sitemap filename. | |
write (&$handle, $str) | |
gzwrite() / fwrite() wrapper | |
xmlHead () | |
Return the XML required to open an XML file. | |
xmlSchema () | |
Return the XML schema being used. | |
Public Attributes | |
bool | $compress |
Whether or not to use compression. | |
object | $dbr |
A database slave object. | |
resource | $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 = array() |
The number of entries to save in each sitemap file. | |
array | $namespaces = array() |
A one-dimensional array of namespaces in the wiki. | |
array | $priorities = array() |
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. | |
const | GS_MAIN = -2 |
const | GS_TALK = -1 |
Private Member Functions | |
setNamespacePriorities () | |
Static Private Member Functions | |
static | init_path ($fspath) |
Create directory if it does not exist and return pathname with a trailing slash. | |
Private Attributes | |
string | $identifier |
Identifier to use in filenames, default $wgDBname. |
Maintenance script that generates a sitemap for the site.
Definition at line 36 of file generateSitemap.php.
GenerateSitemap::close | ( | &$ | handle | ) |
gzclose() / fclose() wrapper
resource | $handle |
Definition at line 428 of file generateSitemap.php.
Return the XML required to close sitemap file.
Definition at line 531 of file generateSitemap.php.
Return the XML required to close a sitemap index file.
Definition at line 495 of file generateSitemap.php.
GenerateSitemap::fileEntry | ( | $ | url, |
$ | date, | ||
$ | priority | ||
) |
Return the XML for a single sitemap entry.
string | $url | An RFC 2396 compliant URL |
string | $date | A ISO 8601 date |
string | $priority | A priority indicator, 0.0 - 1.0 inclusive with a 0.1 stepsize |
Definition at line 516 of file generateSitemap.php.
GenerateSitemap::generateLimit | ( | $ | namespace | ) |
Populate $this->limit.
int | $namespace |
Definition at line 540 of file generateSitemap.php.
Generate a one-dimensional array of existing namespaces.
Definition at line 244 of file generateSitemap.php.
GenerateSitemap::getPageRes | ( | $ | namespace | ) |
Return a database resolution of all the pages in a given namespace.
int | $namespace | Limit the query to this namespace |
Definition at line 300 of file generateSitemap.php.
GenerateSitemap::guessPriority | ( | $ | namespace | ) |
If the namespace isn't listed on the priority list return the default priority for the namespace, varies depending on whether it's a talkpage or not.
int | $namespace | The namespace to get the priority for |
Definition at line 288 of file generateSitemap.php.
GenerateSitemap::indexEntry | ( | $ | filename | ) |
Return the XML for a single sitemap indexfile entry.
string | $filename | The filename of the sitemap file |
Definition at line 482 of file generateSitemap.php.
static GenerateSitemap::init_path | ( | $ | fspath | ) | [static, private] |
Create directory if it does not exist and return pathname with a trailing slash.
string | $fspath |
Definition at line 232 of file generateSitemap.php.
Main loop.
Definition at line 316 of file generateSitemap.php.
GenerateSitemap::open | ( | $ | file, |
$ | flags | ||
) |
gzopen() / fopen() wrapper
string | $file | |
string | $flags |
Definition at line 396 of file generateSitemap.php.
Return the XML required to open a sitemap file.
Definition at line 504 of file generateSitemap.php.
Return the XML required to open a sitemap index file.
Definition at line 472 of file generateSitemap.php.
GenerateSitemap::priority | ( | $ | namespace | ) |
Get the priority of a given namespace.
int | $namespace | The namespace to get the priority for |
Definition at line 274 of file generateSitemap.php.
References namespaces.
GenerateSitemap::setNamespacePriorities | ( | ) | [private] |
Definition at line 185 of file generateSitemap.php.
GenerateSitemap::sitemapFilename | ( | $ | namespace, |
$ | count | ||
) |
Get a sitemap filename.
int | $namespace | The namespace |
int | $count | The count |
Definition at line 443 of file generateSitemap.php.
GenerateSitemap::write | ( | &$ | handle, |
$ | str | ||
) |
gzwrite() / fwrite() wrapper
resource | $handle | |
string | $str |
Definition at line 412 of file generateSitemap.php.
Return the XML required to open an XML file.
Definition at line 454 of file generateSitemap.php.
Return the XML schema being used.
Definition at line 463 of file generateSitemap.php.
bool GenerateSitemap::$compress |
Whether or not to use compression.
Definition at line 73 of file generateSitemap.php.
object GenerateSitemap::$dbr |
A database slave object.
Definition at line 109 of file generateSitemap.php.
resource GenerateSitemap::$file |
A resource pointing to a sitemap file.
Definition at line 121 of file generateSitemap.php.
resource GenerateSitemap::$findex |
A resource pointing to the sitemap index file.
Definition at line 115 of file generateSitemap.php.
string GenerateSitemap::$fspath |
The path to prepend to the filename.
Definition at line 60 of file generateSitemap.php.
string GenerateSitemap::$identifier [private] |
Identifier to use in filenames, default $wgDBname.
Definition at line 127 of file generateSitemap.php.
The number of entries to save in each sitemap file.
Definition at line 85 of file generateSitemap.php.
array GenerateSitemap::$namespaces = array() |
A one-dimensional array of namespaces in the wiki.
Definition at line 97 of file generateSitemap.php.
Key => value entries of namespaces and their priorities.
Definition at line 91 of file generateSitemap.php.
int GenerateSitemap::$size_limit |
The maximum size of a sitemap file.
http://www.sitemaps.org/faq.php#faq_sitemap_size
Definition at line 54 of file generateSitemap.php.
bool GenerateSitemap::$skipRedirects |
Whether or not to include redirection pages.
Definition at line 79 of file generateSitemap.php.
string GenerateSitemap::$timestamp |
When this sitemap batch was generated.
Definition at line 103 of file generateSitemap.php.
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 46 of file generateSitemap.php.
string GenerateSitemap::$urlpath |
The URL path to prepend to filenames in the index; should resolve to the same directory as $fspath.
Definition at line 67 of file generateSitemap.php.
const GenerateSitemap::GS_MAIN = -2 |
Definition at line 37 of file generateSitemap.php.
const GenerateSitemap::GS_TALK = -1 |
Definition at line 38 of file generateSitemap.php.