|
MediaWiki master
|
Utility for generating a sitemap. More...
Public Member Functions | |
| __construct (Language $contLang, LanguageConverterFactory $languageConverterFactory, GenderCache $genderCache,) | |
| additionalNamespaces (?array $namespaces) | |
| Add namespaces to the selected namespace list. | |
| getXml (IReadableDatabase $dbr) | |
| Use the previously set options to generate an XML sitemap. | |
| idRange (?int $startId, ?int $endId) | |
| Limit the page_id range to the given half-open interval. | |
| limit (int $limit) | |
| Limit the number of returned results. | |
| namespaces (?array $namespaces) | |
| Set the selected namespaces. | |
| namespacesFromConfig (Config $config) | |
| Set the included/excluded namespace list based on configuration. | |
| nextBatch () | |
| If a previous call to getXml() reached the limit set by limit() and there were still more rows, calling this will advance an internal cursor to the start of the next batch, and return true. | |
| skipRedirects (bool $skip=true) | |
| Skip redirects. | |
Static Public Member Functions | |
| static | getVariants (Language $contLang, LanguageConverterFactory $languageConverterFactory,) |
Utility for generating a sitemap.
Definition at line 20 of file SitemapGenerator.php.
| MediaWiki\Page\SitemapGenerator::__construct | ( | Language | $contLang, |
| LanguageConverterFactory | $languageConverterFactory, | ||
| GenderCache | $genderCache ) |
Definition at line 53 of file SitemapGenerator.php.
References MediaWiki\Page\SitemapGenerator\getVariants(), and MediaWiki\Language\Language\needsGenderDistinction().
| MediaWiki\Page\SitemapGenerator::additionalNamespaces | ( | ?array | $namespaces | ) |
Add namespaces to the selected namespace list.
If namespacesFromConfig() was already called, the selected namespace list will include namespaces from both $wgSitemapNamespaces and $namespaces.
| array | null | $namespaces |
Definition at line 81 of file SitemapGenerator.php.
|
static |
Definition at line 38 of file SitemapGenerator.php.
References MediaWiki\Language\Language\getCode(), and MediaWiki\Language\LanguageConverterFactory\getLanguageConverter().
Referenced by MediaWiki\Page\SitemapGenerator\__construct().
| MediaWiki\Page\SitemapGenerator::getXml | ( | IReadableDatabase | $dbr | ) |
Use the previously set options to generate an XML sitemap.
| IReadableDatabase | $dbr |
Definition at line 200 of file SitemapGenerator.php.
References MediaWiki\Html\Html\element(), Wikimedia\Rdbms\IReadableDatabase\expr(), MediaWiki\Page\SitemapGenerator\limit(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\makeTitle(), Wikimedia\Rdbms\IReadableDatabase\newSelectQueryBuilder(), MediaWiki\Page\SitemapGenerator\skipRedirects(), and wfTimestamp().
| MediaWiki\Page\SitemapGenerator::idRange | ( | ?int | $startId, |
| ?int | $endId ) |
Limit the page_id range to the given half-open interval.
| int | null | $startId | The start ID, or null for unlimited |
| int | null | $endId | The end ID, or null for unlimited. Only pages with a page_id less than this value will be returned. |
Definition at line 148 of file SitemapGenerator.php.
| MediaWiki\Page\SitemapGenerator::limit | ( | int | $limit | ) |
Limit the number of returned results.
| int | $limit |
Definition at line 171 of file SitemapGenerator.php.
References MediaWiki\Page\SitemapGenerator\limit().
Referenced by MediaWiki\Page\SitemapGenerator\getXml(), and MediaWiki\Page\SitemapGenerator\limit().
| MediaWiki\Page\SitemapGenerator::namespaces | ( | ?array | $namespaces | ) |
Set the selected namespaces.
| int[] | null | $namespaces |
Definition at line 68 of file SitemapGenerator.php.
| MediaWiki\Page\SitemapGenerator::namespacesFromConfig | ( | Config | $config | ) |
Set the included/excluded namespace list based on configuration.
| Config | $config |
Definition at line 96 of file SitemapGenerator.php.
References MediaWiki\MainConfigNames\DefaultRobotPolicy, MediaWiki\Config\Config\get(), MediaWiki\MainConfigNames\NamespaceRobotPolicies, and MediaWiki\MainConfigNames\SitemapNamespaces.
| MediaWiki\Page\SitemapGenerator::nextBatch | ( | ) |
If a previous call to getXml() reached the limit set by limit() and there were still more rows, calling this will advance an internal cursor to the start of the next batch, and return true.
If there were no more rows, return false.
Definition at line 185 of file SitemapGenerator.php.
| MediaWiki\Page\SitemapGenerator::skipRedirects | ( | bool | $skip = true | ) |
Skip redirects.
| bool | $skip |
Definition at line 160 of file SitemapGenerator.php.
References MediaWiki\Page\SitemapGenerator\skipRedirects().
Referenced by MediaWiki\Page\SitemapGenerator\getXml(), and MediaWiki\Page\SitemapGenerator\skipRedirects().