MediaWiki
REL1_19
|
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 | |
$compress | |
$dbr | |
$file | |
$findex | |
$fspath | |
$limit = array() | |
$namespaces = array() | |
$priorities = array() | |
$size_limit | |
$timestamp | |
$url_limit | |
$urlpath | |
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 | |
$identifier |
Definition at line 31 of file generateSitemap.php.
Constructor.
Reimplemented from Maintenance.
Definition at line 134 of file generateSitemap.php.
References Maintenance\addOption().
GenerateSitemap::close | ( | &$ | handle | ) |
gzclose() / fclose() wrapper
Definition at line 373 of file generateSitemap.php.
Referenced by main().
Return the XML required to close sitemap file.
Definition at line 473 of file generateSitemap.php.
Referenced by generateLimit(), and main().
Return the XML required to close a sitemap index file.
Definition at line 438 of file generateSitemap.php.
Referenced by main().
Execute.
Reimplemented from Maintenance.
Definition at line 146 of file generateSitemap.php.
References generateNamespaces(), Maintenance\getOption(), init_path(), main(), setNamespacePriorities(), wfGetDB(), wfTimestamp(), wfTimestampNow(), and wfWikiID().
GenerateSitemap::fileEntry | ( | $ | url, |
$ | date, | ||
$ | priority | ||
) |
Return the XML for a single sitemap entry.
$url | String: an RFC 2396 compliant URL |
$date | String: a ISO 8601 date |
$priority | String: a priority indicator, 0.0 - 1.0 inclusive with a 0.1 stepsize |
Definition at line 459 of file generateSitemap.php.
Referenced by generateLimit(), and main().
GenerateSitemap::generateLimit | ( | $ | namespace | ) |
Populate $this->limit.
Definition at line 480 of file generateSitemap.php.
References $title, closeFile(), fileEntry(), Title\makeTitle(), openFile(), priority(), and wfTimestamp().
Referenced by main().
Generate a one-dimensional array of existing namespaces.
Definition at line 226 of file generateSitemap.php.
References $res, and $wgSitemapNamespaces.
Referenced by execute().
GenerateSitemap::getPageRes | ( | $ | namespace | ) |
Return a database resolution of all the pages in a given namespace.
$namespace | Integer: limit the query to this namespace |
Definition at line 276 of file generateSitemap.php.
Referenced by main().
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.
$namespace | Integer: the namespace to get the priority for |
Definition at line 266 of file generateSitemap.php.
References GS_MAIN, GS_TALK, and MWNamespace\isMain().
Referenced by priority().
GenerateSitemap::indexEntry | ( | $ | filename | ) |
Return the XML for a single sitemap indexfile entry.
$filename | String: the filename of the sitemap file |
Definition at line 425 of file generateSitemap.php.
Referenced by main().
static GenerateSitemap::init_path | ( | $ | fspath | ) | [static, private] |
Create directory if it does not exist and return pathname with a trailing slash.
$fspath | string |
Definition at line 211 of file generateSitemap.php.
References $fspath, and wfMkdirParents().
Referenced by execute().
Main loop.
Definition at line 291 of file generateSitemap.php.
References $res, $title, $wgContLang, close(), closeFile(), closeIndex(), fileEntry(), generateLimit(), getPageRes(), indexEntry(), Title\makeTitle(), open(), openFile(), openIndex(), Maintenance\output(), priority(), sitemapFilename(), wfTimestamp(), and write().
Referenced by execute().
GenerateSitemap::open | ( | $ | file, |
$ | flags | ||
) |
gzopen() / fopen() wrapper
Definition at line 349 of file generateSitemap.php.
References $file, and wfDebugDieBacktrace().
Referenced by main().
Return the XML required to open a sitemap file.
Definition at line 447 of file generateSitemap.php.
References xmlHead(), and xmlSchema().
Referenced by generateLimit(), and main().
Return the XML required to open a sitemap index file.
Definition at line 415 of file generateSitemap.php.
References xmlHead(), and xmlSchema().
Referenced by main().
GenerateSitemap::priority | ( | $ | namespace | ) |
Get the priority of a given namespace.
$namespace | Integer: the namespace to get the priority for |
Definition at line 254 of file generateSitemap.php.
References guessPriority().
Referenced by generateLimit(), and main().
GenerateSitemap::setNamespacePriorities | ( | ) | [private] |
Definition at line 164 of file generateSitemap.php.
References $wgSitemapNamespacesPriorities, GS_MAIN, and GS_TALK.
Referenced by execute().
GenerateSitemap::sitemapFilename | ( | $ | namespace, |
$ | count | ||
) |
Get a sitemap filename.
$namespace | Integer: the namespace |
$count | Integer: the count |
Definition at line 387 of file generateSitemap.php.
References $ext.
Referenced by main().
GenerateSitemap::write | ( | &$ | handle, |
$ | str | ||
) |
gzwrite() / fwrite() wrapper
Definition at line 360 of file generateSitemap.php.
References wfDebugDieBacktrace().
Referenced by main().
Return the XML required to open an XML file.
Definition at line 397 of file generateSitemap.php.
Referenced by openFile(), and openIndex().
Return the XML schema being used.
Definition at line 406 of file generateSitemap.php.
Referenced by openFile(), and openIndex().
GenerateSitemap::$compress |
Definition at line 72 of file generateSitemap.php.
GenerateSitemap::$dbr |
Definition at line 107 of file generateSitemap.php.
GenerateSitemap::$file |
Definition at line 122 of file generateSitemap.php.
Referenced by open().
GenerateSitemap::$findex |
Definition at line 114 of file generateSitemap.php.
GenerateSitemap::$fspath |
Definition at line 58 of file generateSitemap.php.
Referenced by init_path().
GenerateSitemap::$identifier [private] |
Definition at line 129 of file generateSitemap.php.
GenerateSitemap::$limit = array() |
Definition at line 79 of file generateSitemap.php.
GenerateSitemap::$namespaces = array() |
Definition at line 93 of file generateSitemap.php.
GenerateSitemap::$priorities = array() |
Definition at line 86 of file generateSitemap.php.
GenerateSitemap::$size_limit |
Definition at line 51 of file generateSitemap.php.
GenerateSitemap::$timestamp |
Definition at line 100 of file generateSitemap.php.
GenerateSitemap::$url_limit |
Definition at line 42 of file generateSitemap.php.
GenerateSitemap::$urlpath |
Definition at line 65 of file generateSitemap.php.
const GenerateSitemap::GS_MAIN = -2 |
Definition at line 32 of file generateSitemap.php.
Referenced by guessPriority(), and setNamespacePriorities().
const GenerateSitemap::GS_TALK = -1 |
Definition at line 33 of file generateSitemap.php.
Referenced by guessPriority(), and setNamespacePriorities().