Inherits Maintenance.
Public Member Functions | |
__construct () | |
Constructor. | |
execute () | |
Execute. | |
generateNamespaces () | |
Generate a one-dimensional array of existing namespaces. | |
priority ($namespace) | |
Get the priority of 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. | |
getPageRes ($namespace) | |
Return a database resolution of all the pages in a given namespace. | |
main () | |
Main loop. | |
open ($file, $flags) | |
gzopen() / fopen() wrapper | |
write (&$handle, $str) | |
gzwrite() / fwrite() wrapper | |
close (&$handle) | |
gzclose() / fclose() wrapper | |
openIndex () | |
Return the XML required to open a sitemap index file. | |
openFile () | |
Return the XML required to open a sitemap file. | |
generateLimit ($namespace) | |
Populate $this->limit. | |
Static Public Member Functions | |
sitemapFilename ($namespace, $count) | |
Get a sitemap filename. | |
xmlHead () | |
Return the XML required to open an XML file. | |
xmlSchema () | |
Return the XML schema being used. | |
indexEntry ($filename) | |
Return the XML for a single sitemap indexfile entry. | |
closeIndex () | |
Return the XML required to close a sitemap index file. | |
fileEntry ($url, $date, $priority) | |
Return the XML for a single sitemap entry. | |
closeFile () | |
Return the XML required to close sitemap file. | |
Public Attributes | |
$url_limit | |
$size_limit | |
$fspath | |
$path | |
$compress | |
$limit = array() | |
$priorities = array() | |
$namespaces = array() | |
$timestamp | |
$dbr | |
$findex | |
$file | |
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. |
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html
Copyright © 2005, Ævar Arnfjörð Bjarmason Copyright © 2005, Jens Frank <jeluf@gmx.de> Copyright © 2005, Brion Vibber <brion@pobox.com>
http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
Definition at line 36 of file generateSitemap.php.
GenerateSitemap::__construct | ( | ) |
Constructor.
Reimplemented from Maintenance.
Definition at line 129 of file generateSitemap.php.
References Maintenance::addOption().
GenerateSitemap::close | ( | &$ | handle | ) |
gzclose() / fclose() wrapper
Definition at line 342 of file generateSitemap.php.
Referenced by main().
GenerateSitemap::closeFile | ( | ) | [static] |
Return the XML required to close sitemap file.
Definition at line 458 of file generateSitemap.php.
Referenced by generateLimit(), and main().
GenerateSitemap::closeIndex | ( | ) | [static] |
Return the XML required to close a sitemap index file.
Definition at line 419 of file generateSitemap.php.
Referenced by main().
GenerateSitemap::execute | ( | ) |
Execute.
Reimplemented from Maintenance.
Definition at line 140 of file generateSitemap.php.
References $wgScriptPath, generateNamespaces(), Maintenance::getOption(), init_path(), main(), setNamespacePriorities(), wfGetDB(), wfTimestamp(), wfTimestampNow(), and wfWikiID().
GenerateSitemap::fileEntry | ( | $ | url, | |
$ | date, | |||
$ | priority | |||
) | [static] |
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 443 of file generateSitemap.php.
Referenced by generateLimit(), and main().
GenerateSitemap::generateLimit | ( | $ | namespace | ) |
Populate $this->limit.
Definition at line 465 of file generateSitemap.php.
References $title, closeFile(), fileEntry(), Title::makeTitle(), openFile(), priority(), and wfTimestamp().
Referenced by main().
GenerateSitemap::generateNamespaces | ( | ) |
Generate a one-dimensional array of existing namespaces.
Definition at line 196 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.
int | $namespace Limit the query to this namespace |
Definition at line 250 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.
int | $namespace The namespace to get the priority for |
Definition at line 239 of file generateSitemap.php.
References MWNamespace::isMain().
Referenced by priority().
GenerateSitemap::indexEntry | ( | $ | filename | ) | [static] |
Return the XML for a single sitemap indexfile entry.
string | $filename The filename of the sitemap file |
Definition at line 404 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.
Definition at line 181 of file generateSitemap.php.
References $fspath, and wfMkdirParents().
Referenced by execute().
GenerateSitemap::main | ( | ) |
Main loop.
Definition at line 267 of file generateSitemap.php.
References $filename, $i, $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 325 of file generateSitemap.php.
References $file.
Referenced by main().
GenerateSitemap::openFile | ( | ) |
Return the XML required to open a sitemap file.
Definition at line 428 of file generateSitemap.php.
References xmlHead(), and xmlSchema().
Referenced by generateLimit(), and main().
GenerateSitemap::openIndex | ( | ) |
Return the XML required to open a sitemap index file.
Definition at line 391 of file generateSitemap.php.
References xmlHead(), and xmlSchema().
Referenced by main().
GenerateSitemap::priority | ( | $ | namespace | ) |
Get the priority of a given namespace.
int | $namespace The namespace to get the priority for + |
Definition at line 226 of file generateSitemap.php.
References guessPriority().
Referenced by generateLimit(), and main().
GenerateSitemap::setNamespacePriorities | ( | ) | [private] |
GenerateSitemap::sitemapFilename | ( | $ | namespace, | |
$ | count | |||
) | [static] |
Get a sitemap filename.
int | $namespace The namespace | |
int | $count The count |
Definition at line 359 of file generateSitemap.php.
References $ext.
Referenced by main().
GenerateSitemap::write | ( | &$ | handle, | |
$ | str | |||
) |
gzwrite() / fwrite() wrapper
Definition at line 332 of file generateSitemap.php.
Referenced by main().
GenerateSitemap::xmlHead | ( | ) | [static] |
Return the XML required to open an XML file.
Definition at line 371 of file generateSitemap.php.
Referenced by openFile(), and openIndex().
GenerateSitemap::xmlSchema | ( | ) | [static] |
Return the XML schema being used.
Definition at line 382 of file generateSitemap.php.
Referenced by openFile(), and openIndex().
GenerateSitemap::$compress |
Definition at line 74 of file generateSitemap.php.
GenerateSitemap::$dbr |
Definition at line 109 of file generateSitemap.php.
GenerateSitemap::$file |
GenerateSitemap::$findex |
Definition at line 116 of file generateSitemap.php.
GenerateSitemap::$fspath |
GenerateSitemap::$limit = array() |
Definition at line 81 of file generateSitemap.php.
GenerateSitemap::$namespaces = array() |
Definition at line 95 of file generateSitemap.php.
GenerateSitemap::$path |
Definition at line 67 of file generateSitemap.php.
GenerateSitemap::$priorities = array() |
Definition at line 88 of file generateSitemap.php.
GenerateSitemap::$size_limit |
Definition at line 53 of file generateSitemap.php.
GenerateSitemap::$timestamp |
Definition at line 102 of file generateSitemap.php.
GenerateSitemap::$url_limit |
Definition at line 44 of file generateSitemap.php.