MediaWiki  REL1_19
GenerateSitemap Class Reference
Inheritance diagram for GenerateSitemap:
Collaboration diagram for GenerateSitemap:

List of all members.

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

Detailed Description

Definition at line 31 of file generateSitemap.php.


Constructor & Destructor Documentation

Constructor.

Reimplemented from Maintenance.

Definition at line 134 of file generateSitemap.php.

References Maintenance\addOption().

Here is the call graph for this function:


Member Function Documentation

GenerateSitemap::close ( &$  handle)

gzclose() / fclose() wrapper

Definition at line 373 of file generateSitemap.php.

Referenced by main().

Here is the caller graph for this function:

Return the XML required to close sitemap file.

Returns:
String

Definition at line 473 of file generateSitemap.php.

Referenced by generateLimit(), and main().

Here is the caller graph for this function:

Return the XML required to close a sitemap index file.

Returns:
String

Definition at line 438 of file generateSitemap.php.

Referenced by main().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

GenerateSitemap::fileEntry ( url,
date,
priority 
)

Return the XML for a single sitemap entry.

Parameters:
$urlString: an RFC 2396 compliant URL
$dateString: a ISO 8601 date
$priorityString: a priority indicator, 0.0 - 1.0 inclusive with a 0.1 stepsize
Returns:
String

Definition at line 459 of file generateSitemap.php.

Referenced by generateLimit(), and main().

Here is the caller graph for this function:

Populate $this->limit.

Definition at line 480 of file generateSitemap.php.

References $title, closeFile(), fileEntry(), Title\makeTitle(), openFile(), priority(), and wfTimestamp().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

Generate a one-dimensional array of existing namespaces.

Definition at line 226 of file generateSitemap.php.

References $res, and $wgSitemapNamespaces.

Referenced by execute().

Here is the caller graph for this function:

GenerateSitemap::getPageRes ( namespace)

Return a database resolution of all the pages in a given namespace.

Parameters:
$namespaceInteger: limit the query to this namespace
Returns:
Resource

Definition at line 276 of file generateSitemap.php.

Referenced by main().

Here is the caller graph for this function:

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.

Parameters:
$namespaceInteger: the namespace to get the priority for
Returns:
String

Definition at line 266 of file generateSitemap.php.

References GS_MAIN, GS_TALK, and MWNamespace\isMain().

Referenced by priority().

Here is the call graph for this function:

Here is the caller graph for this function:

GenerateSitemap::indexEntry ( filename)

Return the XML for a single sitemap indexfile entry.

Parameters:
$filenameString: the filename of the sitemap file
Returns:
String

Definition at line 425 of file generateSitemap.php.

Referenced by main().

Here is the caller graph for this function:

static GenerateSitemap::init_path ( fspath) [static, private]

Create directory if it does not exist and return pathname with a trailing slash.

Parameters:
$fspathstring
Returns:
null|string

Definition at line 211 of file generateSitemap.php.

References $fspath, and wfMkdirParents().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

GenerateSitemap::open ( file,
flags 
)

gzopen() / fopen() wrapper

Returns:
Resource

Definition at line 349 of file generateSitemap.php.

References $file, and wfDebugDieBacktrace().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

Return the XML required to open a sitemap file.

Returns:
String

Definition at line 447 of file generateSitemap.php.

References xmlHead(), and xmlSchema().

Referenced by generateLimit(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

Return the XML required to open a sitemap index file.

Returns:
String

Definition at line 415 of file generateSitemap.php.

References xmlHead(), and xmlSchema().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

GenerateSitemap::priority ( namespace)

Get the priority of a given namespace.

Parameters:
$namespaceInteger: the namespace to get the priority for
Returns:
String

Definition at line 254 of file generateSitemap.php.

References guessPriority().

Referenced by generateLimit(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 164 of file generateSitemap.php.

References $wgSitemapNamespacesPriorities, GS_MAIN, and GS_TALK.

Referenced by execute().

Here is the caller graph for this function:

GenerateSitemap::sitemapFilename ( namespace,
count 
)

Get a sitemap filename.

Parameters:
$namespaceInteger: the namespace
$countInteger: the count
Returns:
String

Definition at line 387 of file generateSitemap.php.

References $ext.

Referenced by main().

Here is the caller graph for this function:

GenerateSitemap::write ( &$  handle,
str 
)

gzwrite() / fwrite() wrapper

Definition at line 360 of file generateSitemap.php.

References wfDebugDieBacktrace().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

Return the XML required to open an XML file.

Returns:
string

Definition at line 397 of file generateSitemap.php.

Referenced by openFile(), and openIndex().

Here is the caller graph for this function:

Return the XML schema being used.

Returns:
String

Definition at line 406 of file generateSitemap.php.

Referenced by openFile(), and openIndex().

Here is the caller graph for this function:


Member Data Documentation

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.

Definition at line 32 of file generateSitemap.php.

Referenced by guessPriority(), and setNamespacePriorities().

Definition at line 33 of file generateSitemap.php.

Referenced by guessPriority(), and setNamespacePriorities().


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