[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/ -> Title.php (summary)

Representation of a title within %MediaWiki. See title.txt

File Size: 4817 lines (144 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

Title:: (185 methods):
  getTitleParser()
  getTitleFormatter()
  __construct()
  newFromDBkey()
  newFromTitleValue()
  newFromText()
  newFromURL()
  getTitleCache()
  getSelectFields()
  newFromID()
  newFromIDs()
  newFromRow()
  loadFromRow()
  makeTitle()
  makeTitleSafe()
  newMainPage()
  newFromRedirect()
  newFromRedirectRecurse()
  newFromRedirectArray()
  nameOf()
  legalChars()
  getTitleInvalidRegex()
  convertByteClassToUnicodeClass()
  makeName()
  escapeFragmentForURL()
  compare()
  isLocal()
  isExternal()
  getInterwiki()
  wasLocalInterwiki()
  isTrans()
  getTransWikiID()
  getTitleValue()
  getText()
  getPartialURL()
  getDBkey()
  getUserCaseDBKey()
  getNamespace()
  getContentModel()
  hasContentModel()
  getNsText()
  getSubjectNsText()
  getTalkNsText()
  canTalk()
  canExist()
  isWatchable()
  isSpecialPage()
  isSpecial()
  fixSpecialName()
  inNamespace()
  inNamespaces()
  hasSubjectNamespace()
  isContentPage()
  isMovable()
  isMainPage()
  isSubpage()
  isConversionTable()
  isWikitextPage()
  isCssOrJsPage()
  isCssJsSubpage()
  getSkinFromCssJsSubpage()
  isCssSubpage()
  isJsSubpage()
  isTalkPage()
  getTalkPage()
  getSubjectPage()
  getDefaultNamespace()
  getFragment()
  hasFragment()
  getFragmentForURL()
  setFragment()
  prefix()
  getPrefixedDBkey()
  getPrefixedText()
  __toString()
  getFullText()
  getRootText()
  getRootTitle()
  getBaseText()
  getBaseTitle()
  getSubpageText()
  getSubpage()
  getSubpageUrlForm()
  getPrefixedURL()
  fixUrlQueryArgs()
  getFullURL()
  getLocalURL()
  getLinkURL()
  getInternalURL()
  getCanonicalURL()
  getEditURL()
  userIsWatching()
  quickUserCan()
  userCan()
  getUserPermissionsErrors()
  checkQuickPermissions()
  resultToError()
  checkPermissionHooks()
  checkSpecialsAndNSPermissions()
  checkCSSandJSPermissions()
  checkPageRestrictions()
  checkCascadingSourcesRestrictions()
  checkActionPermissions()
  checkUserBlock()
  checkReadPermissions()
  missingPermissionError()
  getUserPermissionsErrorsInternal()
  getFilteredRestrictionTypes()
  getRestrictionTypes()
  getTitleProtection()
  deleteTitleProtection()
  isSemiProtected()
  isProtected()
  isNamespaceProtected()
  isCascadeProtected()
  areCascadeProtectionSourcesLoaded()
  getCascadeProtectionSources()
  areRestrictionsLoaded()
  getRestrictions()
  getAllRestrictions()
  getRestrictionExpiry()
  areRestrictionsCascading()
  loadRestrictionsFromResultWrapper()
  loadRestrictionsFromRows()
  loadRestrictions()
  flushRestrictions()
  purgeExpiredRestrictions()
  hasSubpages()
  getSubpages()
  isDeleted()
  isDeletedQuick()
  getArticleID()
  isRedirect()
  getLength()
  getLatestRevID()
  resetArticleID()
  capitalize()
  secureAndSplit()
  getLinksTo()
  getTemplateLinksTo()
  getLinksFrom()
  getTemplateLinksFrom()
  getBrokenLinksFrom()
  getSquidURLs()
  purgeSquid()
  moveNoAuth()
  isValidMoveOperation()
  validateFileMoveOperation()
  moveTo()
  moveSubpages()
  isSingleRevRedirect()
  isValidMoveTarget()
  getParentCategories()
  getParentCategoryTree()
  pageCond()
  getPreviousRevisionID()
  getNextRevisionID()
  getFirstRevision()
  getEarliestRevTime()
  isNewPage()
  isBigDeletion()
  estimateRevisionCount()
  countRevisionsBetween()
  getAuthorsBetween()
  countAuthorsBetween()
  equals()
  isSubpageOf()
  exists()
  isAlwaysKnown()
  isKnown()
  hasSourceText()
  getDefaultMessageText()
  invalidateCache()
  touchLinks()
  getTouched()
  getNotificationTimestamp()
  getNamespaceKey()
  getRedirectsHere()
  isValidRedirectTarget()
  getBacklinkCache()
  canUseNoindex()
  getCategorySortkey()
  getPageLanguage()
  getPageViewLanguage()
  getEditNotices()


Class: Title  - X-Ref

Represents a title within MediaWiki.
Optionally may contain an interwiki designation or namespace.

getTitleParser()   X-Ref
B/C kludge: provide a TitleParser for use by Title.
Ideally, Title would have no methods that need this.
Avoid usage of this singleton by using TitleValue
and the associated services when possible.

return: TitleParser

getTitleFormatter()   X-Ref
B/C kludge: provide a TitleParser for use by Title.
Ideally, Title would have no methods that need this.
Avoid usage of this singleton by using TitleValue
and the associated services when possible.

return: TitleFormatter

__construct()   X-Ref
No description

newFromDBkey( $key )   X-Ref
Create a new Title from a prefixed DB key

param: string $key The database key, which has underscores
return: Title|null Title, or null on an error

newFromTitleValue( TitleValue $titleValue )   X-Ref
Create a new Title from a TitleValue

param: TitleValue $titleValue Assumed to be safe.
return: Title

newFromText( $text, $defaultNamespace = NS_MAIN )   X-Ref
Create a new Title from text, such as what one would find in a link. De-
codes any HTML entities in the text.

param: string $text The link text; spaces, prefixes, and an
param: int $defaultNamespace The namespace to use if none is specified
return: Title|null Title or null on an error.

newFromURL( $url )   X-Ref
THIS IS NOT THE FUNCTION YOU WANT. Use Title::newFromText().

Example of wrong and broken code:
$title = Title::newFromURL( $wgRequest->getVal( 'title' ) );

Example of right code:
$title = Title::newFromText( $wgRequest->getVal( 'title' ) );

Create a new Title from URL-encoded text. Ensures that
the given title's length does not exceed the maximum.

param: string $url The title, as might be taken from a URL
return: Title|null The new object, or null on an error

getTitleCache()   X-Ref

return: MapCacheLRU

getSelectFields()   X-Ref
Returns a list of fields that are to be selected for initializing Title
objects or LinkCache entries. Uses $wgContentHandlerUseDB to determine
whether to include page_content_model.

return: array

newFromID( $id, $flags = 0 )   X-Ref
Create a new Title from an article ID

param: int $id The page_id corresponding to the Title to create
param: int $flags Use Title::GAID_FOR_UPDATE to use master
return: Title|null The new object, or null on an error

newFromIDs( $ids )   X-Ref
Make an array of titles from an array of IDs

param: int[] $ids Array of IDs
return: Title[] Array of Titles

newFromRow( $row )   X-Ref
Make a Title object from a DB row

param: stdClass $row Object database row (needs at least page_title,page_namespace)
return: Title Corresponding Title

loadFromRow( $row )   X-Ref
Load Title object fields from a DB row.
If false is given, the title will be treated as non-existing.

param: stdClass|bool $row Database row

makeTitle( $ns, $title, $fragment = '', $interwiki = '' )   X-Ref
Create a new Title from a namespace index and a DB key.
It's assumed that $ns and $title are *valid*, for instance when
they came directly from the database or a special page name.
For convenience, spaces are converted to underscores so that
eg user_text fields can be used directly.

param: int $ns The namespace of the article
param: string $title The unprefixed database key form
param: string $fragment The link fragment (after the "#")
param: string $interwiki The interwiki prefix
return: Title The new object

makeTitleSafe( $ns, $title, $fragment = '', $interwiki = '' )   X-Ref
Create a new Title from a namespace index and a DB key.
The parameters will be checked for validity, which is a bit slower
than makeTitle() but safer for user-provided data.

param: int $ns The namespace of the article
param: string $title Database key form
param: string $fragment The link fragment (after the "#")
param: string $interwiki Interwiki prefix
return: Title The new object, or null on an error

newMainPage()   X-Ref
Create a new Title for the Main Page

return: Title The new object

newFromRedirect( $text )   X-Ref
Extract a redirect destination from a string and return the
Title, or null if the text doesn't contain a valid redirect
This will only return the very next target, useful for
the redirect table and other checks that don't need full recursion

param: string $text Text with possible redirect
return: Title The corresponding Title

newFromRedirectRecurse( $text )   X-Ref
Extract a redirect destination from a string and return the
Title, or null if the text doesn't contain a valid redirect
This will recurse down $wgMaxRedirects times or until a non-redirect target is hit
in order to provide (hopefully) the Title of the final destination instead of another redirect

param: string $text Text with possible redirect
return: Title

newFromRedirectArray( $text )   X-Ref
Extract a redirect destination from a string and return an
array of Titles, or null if the text doesn't contain a valid redirect
The last element in the array is the final destination after all redirects
have been resolved (up to $wgMaxRedirects times)

param: string $text Text with possible redirect
return: Title[] Array of Titles, with the destination last

nameOf( $id )   X-Ref
Get the prefixed DB key associated with an ID

param: int $id The page_id of the article
return: Title|null An object representing the article, or null if no such article was found

legalChars()   X-Ref
Get a regex character class describing the legal characters in a link

return: string The list of characters, not delimited

getTitleInvalidRegex()   X-Ref
Returns a simple regex that will match on characters and sequences invalid in titles.
Note that this doesn't pick up many things that could be wrong with titles, but that
replacing this regex with something valid will make many titles valid.

return: string Regex string

convertByteClassToUnicodeClass( $byteClass )   X-Ref
Utility method for converting a character sequence from bytes to Unicode.

Primary usecase being converting $wgLegalTitleChars to a sequence usable in
javascript, as PHP uses UTF-8 bytes where javascript uses Unicode code units.

param: string $byteClass
return: string

makeName( $ns, $title, $fragment = '', $interwiki = '' )   X-Ref
Make a prefixed DB key from a DB key and a namespace index

param: int $ns Numerical representation of the namespace
param: string $title The DB key form the title
param: string $fragment The link fragment (after the "#")
param: string $interwiki The interwiki prefix
return: string The prefixed form of the title

escapeFragmentForURL( $fragment )   X-Ref
Escape a text fragment, say from a link, for a URL

param: string $fragment Containing a URL or link fragment (after the "#")
return: string Escaped string

compare( $a, $b )   X-Ref
Callback for usort() to do title sorts by (namespace, title)

param: Title $a
param: Title $b
return: int Result of string comparison, or namespace comparison

isLocal()   X-Ref
Determine whether the object refers to a page within
this project.

return: bool True if this is an in-project interwiki link or a wikilink, false otherwise

isExternal()   X-Ref
Is this Title interwiki?

return: bool

getInterwiki()   X-Ref
Get the interwiki prefix

Use Title::isExternal to check if a interwiki is set

return: string Interwiki prefix

wasLocalInterwiki()   X-Ref
Was this a local interwiki link?

return: bool

isTrans()   X-Ref
Determine whether the object refers to a page within
this project and is transcludable.

return: bool True if this is transcludable

getTransWikiID()   X-Ref
Returns the DB name of the distant wiki which owns the object.

return: string The DB name

getTitleValue()   X-Ref
Get a TitleValue object representing this Title.

return: TitleValue|null

getText()   X-Ref
Get the text form (spaces not underscores) of the main part

return: string Main part of the title

getPartialURL()   X-Ref
Get the URL-encoded form of the main part

return: string Main part of the title, URL-encoded

getDBkey()   X-Ref
Get the main part with underscores

return: string Main part of the title, with underscores

getUserCaseDBKey()   X-Ref
Get the DB key with the initial letter case as specified by the user

return: string DB key

getNamespace()   X-Ref
Get the namespace index, i.e. one of the NS_xxxx constants.

return: int Namespace index

getContentModel( $flags = 0 )   X-Ref
Get the page's content model id, see the CONTENT_MODEL_XXX constants.

param: int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
return: string Content model id

hasContentModel( $id )   X-Ref
Convenience method for checking a title's content model name

param: string $id The content model ID (use the CONTENT_MODEL_XXX constants).
return: bool True if $this->getContentModel() == $id

getNsText()   X-Ref
Get the namespace text

return: string Namespace text

getSubjectNsText()   X-Ref
Get the namespace text of the subject (rather than talk) page

return: string Namespace text

getTalkNsText()   X-Ref
Get the namespace text of the talk page

return: string Namespace text

canTalk()   X-Ref
Could this title have a corresponding talk page?

return: bool

canExist()   X-Ref
Is this in a namespace that allows actual pages?

return: bool

isWatchable()   X-Ref
Can this title be added to a user's watchlist?

return: bool

isSpecialPage()   X-Ref
Returns true if this is a special page.

return: bool

isSpecial( $name )   X-Ref
Returns true if this title resolves to the named special page

param: string $name The special page name
return: bool

fixSpecialName()   X-Ref
If the Title refers to a special page alias which is not the local default, resolve
the alias, and localise the name as necessary.  Otherwise, return $this

return: Title

inNamespace( $ns )   X-Ref
Returns true if the title is inside the specified namespace.

Please make use of this instead of comparing to getNamespace()
This function is much more resistant to changes we may make
to namespaces than code that makes direct comparisons.
param: int $ns The namespace
return: bool

inNamespaces( )   X-Ref
Returns true if the title is inside one of the specified namespaces.

param: int $namespaces,... The namespaces to check for
return: bool

hasSubjectNamespace( $ns )   X-Ref
Returns true if the title has the same subject namespace as the
namespace specified.
For example this method will take NS_USER and return true if namespace
is either NS_USER or NS_USER_TALK since both of them have NS_USER
as their subject namespace.

This is MUCH simpler than individually testing for equivalence
against both NS_USER and NS_USER_TALK, and is also forward compatible.
param: int $ns
return: bool

isContentPage()   X-Ref
Is this Title in a namespace which contains content?
In other words, is this a content page, for the purposes of calculating
statistics, etc?

return: bool

isMovable()   X-Ref
Would anybody with sufficient privileges be able to move this page?
Some pages just aren't movable.

return: bool

isMainPage()   X-Ref
Is this the mainpage?

return: bool

isSubpage()   X-Ref
Is this a subpage?

return: bool

isConversionTable()   X-Ref
Is this a conversion table for the LanguageConverter?

return: bool

isWikitextPage()   X-Ref
Does that page contain wikitext, or it is JS, CSS or whatever?

return: bool

isCssOrJsPage()   X-Ref
Could this page contain custom CSS or JavaScript for the global UI.
This is generally true for pages in the MediaWiki namespace having CONTENT_MODEL_CSS
or CONTENT_MODEL_JAVASCRIPT.

This method does *not* return true for per-user JS/CSS. Use isCssJsSubpage()
for that!

Note that this method should not return true for pages that contain and
show "inactive" CSS or JS.

return: bool

isCssJsSubpage()   X-Ref
Is this a .css or .js subpage of a user page?

return: bool

getSkinFromCssJsSubpage()   X-Ref
Trim down a .css or .js subpage title to get the corresponding skin name

return: string Containing skin name from .css or .js subpage title

isCssSubpage()   X-Ref
Is this a .css subpage of a user page?

return: bool

isJsSubpage()   X-Ref
Is this a .js subpage of a user page?

return: bool

isTalkPage()   X-Ref
Is this a talk page of some sort?

return: bool

getTalkPage()   X-Ref
Get a Title object associated with the talk page of this article

return: Title The object for the talk page

getSubjectPage()   X-Ref
Get a title object associated with the subject page of this
talk page

return: Title The object for the subject page

getDefaultNamespace()   X-Ref
Get the default namespace index, for when there is no namespace

return: int Default namespace index

getFragment()   X-Ref
Get the Title fragment (i.e.\ the bit after the #) in text form

Use Title::hasFragment to check for a fragment

return: string Title fragment

hasFragment()   X-Ref
Check if a Title fragment is set

return: bool

getFragmentForURL()   X-Ref
Get the fragment in URL form, including the "#" character if there is one

return: string Fragment in URL form

setFragment( $fragment )   X-Ref
Set the fragment for this title. Removes the first character from the
specified fragment before setting, so it assumes you're passing it with
an initial "#".

Deprecated for public use, use Title::makeTitle() with fragment parameter.
Still in active use privately.

param: string $fragment Text

prefix( $name )   X-Ref
Prefix some arbitrary text with the namespace or interwiki prefix
of this object

param: string $name The text
return: string The prefixed text

getPrefixedDBkey()   X-Ref
Get the prefixed database key form

return: string The prefixed title, with underscores and

getPrefixedText()   X-Ref
Get the prefixed title with spaces.
This is the form usually used for display

return: string The prefixed title, with spaces

__toString()   X-Ref
Return a string representation of this title

return: string Representation of this title

getFullText()   X-Ref
Get the prefixed title with spaces, plus any fragment
(part beginning with '#')

return: string The prefixed title, with spaces and the fragment, including '#'

getRootText()   X-Ref
Get the root page name text without a namespace, i.e. the leftmost part before any slashes

return: string Root name

getRootTitle()   X-Ref
Get the root page name title, i.e. the leftmost part before any slashes

return: Title Root title

getBaseText()   X-Ref
Get the base page name without a namespace, i.e. the part before the subpage name

return: string Base name

getBaseTitle()   X-Ref
Get the base page name title, i.e. the part before the subpage name

return: Title Base title

getSubpageText()   X-Ref
Get the lowest-level subpage name, i.e. the rightmost part after any slashes

return: string Subpage name

getSubpage( $text )   X-Ref
Get the title for a subpage of the current page

param: string $text The subpage name to add to the title
return: Title Subpage title

getSubpageUrlForm()   X-Ref
Get a URL-encoded form of the subpage text

return: string URL-encoded subpage name

getPrefixedURL()   X-Ref
Get a URL-encoded title (not an actual URL) including interwiki

return: string The URL-encoded form

fixUrlQueryArgs( $query, $query2 = false )   X-Ref
Helper to fix up the get{Canonical,Full,Link,Local,Internal}URL args
get{Canonical,Full,Link,Local,Internal}URL methods accepted an optional
second argument named variant. This was deprecated in favor
of passing an array of option with a "variant" key
Once $query2 is removed for good, this helper can be dropped
and the wfArrayToCgi moved to getLocalURL();

param: array|string $query
param: bool $query2
return: string

getFullURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE )   X-Ref
Get a real URL referring to this title, with interwiki link and
fragment

param: array|string $query
param: bool $query2
param: string $proto Protocol type to use in URL
return: string The URL

getLocalURL( $query = '', $query2 = false )   X-Ref
Get a URL with no fragment or server name (relative URL) from a Title object.
If this page is generated with action=render, however,
$wgServer is prepended to make an absolute URL.

param: string|array $query An optional query string,
param: array $query2 An optional secondary query array. This one MUST
return: string String of the URL.

getLinkURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE )   X-Ref
Get a URL that's the simplest URL that will be valid to link, locally,
to the current Title.  It includes the fragment, but does not include
the server unless action=render is used (or the link is external).  If
there's a fragment but the prefixed text is empty, we just return a link
to the fragment.

The result obviously should not be URL-escaped, but does need to be
HTML-escaped if it's being output in HTML.

param: array $query
param: bool $query2
param: string $proto Protocol to use; setting this will cause a full URL to be used
return: string The URL

getInternalURL( $query = '', $query2 = false )   X-Ref
Get the URL form for an internal link.
- Used in various Squid-related code, in case we have a different
internal hostname for the server from the exposed one.

This uses $wgInternalServer to qualify the path, or $wgServer
if $wgInternalServer is not set. If the server variable used is
protocol-relative, the URL will be expanded to http://

return: string The URL

getCanonicalURL( $query = '', $query2 = false )   X-Ref
Get the URL for a canonical link, for use in things like IRC and
e-mail notifications. Uses $wgCanonicalServer and the
GetCanonicalURL hook.

NOTE: Unlike getInternalURL(), the canonical URL includes the fragment

return: string The URL

getEditURL()   X-Ref
Get the edit URL for this Title

return: string The URL, or a null string if this is an interwiki link

userIsWatching()   X-Ref
Is $wgUser watching this page?

return: bool

quickUserCan( $action, $user = null )   X-Ref
Can $user perform $action on this page?
This skips potentially expensive cascading permission checks
as well as avoids expensive error formatting

Suitable for use for nonessential UI controls in common cases, but
_not_ for functional access control.

May provide false positives, but should never provide a false negative.

param: string $action Action that permission needs to be checked for
param: User $user User to check (since 1.19); $wgUser will be used if not provided.
return: bool

userCan( $action, $user = null, $doExpensiveQueries = true )   X-Ref
Can $user perform $action on this page?

param: string $action Action that permission needs to be checked for
param: User $user User to check (since 1.19); $wgUser will be used if not
param: bool $doExpensiveQueries Set this to false to avoid doing
return: bool

getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true,$ignoreErrors = array()   X-Ref
Can $user perform $action on this page?

param: string $action Action that permission needs to be checked for
param: User $user User to check
param: bool $doExpensiveQueries Set this to false to avoid doing unnecessary
param: array $ignoreErrors Array of Strings Set this to a list of message keys
return: array Array of arguments to wfMessage to explain permissions problems.

checkQuickPermissions( $action, $user, $errors,$doExpensiveQueries, $short)   X-Ref
Permissions checks that fail most often, and which are easiest to test.

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

resultToError( $errors, $result )   X-Ref
Add the resulting error code to the errors array

param: array $errors List of current errors
param: array $result Result of errors
return: array List of errors

checkPermissionHooks( $action, $user, $errors, $doExpensiveQueries, $short )   X-Ref
Check various permission hooks

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

checkSpecialsAndNSPermissions( $action, $user, $errors,$doExpensiveQueries, $short)   X-Ref
Check permissions on special pages & namespaces

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

checkCSSandJSPermissions( $action, $user, $errors, $doExpensiveQueries, $short )   X-Ref
Check CSS/JS sub-page permissions

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

checkPageRestrictions( $action, $user, $errors, $doExpensiveQueries, $short )   X-Ref
Check against page_restrictions table requirements on this
page. The user must possess all required rights for this
action.

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

checkCascadingSourcesRestrictions( $action, $user, $errors,$doExpensiveQueries, $short)   X-Ref
Check restrictions on cascading pages.

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

checkActionPermissions( $action, $user, $errors,$doExpensiveQueries, $short)   X-Ref
Check action permissions not already checked in checkQuickPermissions

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

checkUserBlock( $action, $user, $errors, $doExpensiveQueries, $short )   X-Ref
Check that the user isn't blocked from editing.

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

checkReadPermissions( $action, $user, $errors, $doExpensiveQueries, $short )   X-Ref
Check that the user is allowed to read this page.

param: string $action The action to check
param: User $user User to check
param: array $errors List of current errors
param: bool $doExpensiveQueries Whether or not to perform expensive queries
param: bool $short Short circuit on first error
return: array List of errors

missingPermissionError( $action, $short )   X-Ref
Get a description array when the user doesn't have the right to perform
$action (i.e. when User::isAllowed() returns false)

param: string $action The action to check
param: bool $short Short circuit on first error
return: array List of errors

getUserPermissionsErrorsInternal( $action, $user,$doExpensiveQueries = true, $short = false)   X-Ref
Can $user perform $action on this page? This is an internal function,
which checks ONLY that previously checked by userCan (i.e. it leaves out
checks on wfReadOnly() and blocks)

param: string $action Action that permission needs to be checked for
param: User $user User to check
param: bool $doExpensiveQueries Set this to false to avoid doing unnecessary queries.
param: bool $short Set this to true to stop after the first permission error.
return: array Array of arrays of the arguments to wfMessage to explain permissions problems.

getFilteredRestrictionTypes( $exists = true )   X-Ref
Get a filtered list of all restriction types supported by this wiki.

param: bool $exists True to get all restriction types that apply to
return: array

getRestrictionTypes()   X-Ref
Returns restriction types for the current Title

return: array Applicable restriction types

getTitleProtection()   X-Ref
Is this title subject to title protection?
Title protection is the one applied against creation of such title.

return: array|bool An associative array representing any existent title

deleteTitleProtection()   X-Ref
Remove any title protection due to page existing


isSemiProtected( $action = 'edit' )   X-Ref
Is this page "semi-protected" - the *only* protection levels are listed
in $wgSemiprotectedRestrictionLevels?

param: string $action Action to check (default: edit)
return: bool

isProtected( $action = '' )   X-Ref
Does the title correspond to a protected article?

param: string $action The action the page is protected from,
return: bool

isNamespaceProtected( User $user )   X-Ref
Determines if $user is unable to edit this page because it has been protected
by $wgNamespaceProtection.

param: User $user User object to check permissions
return: bool

isCascadeProtected()   X-Ref
Cascading protection: Return true if cascading restrictions apply to this page, false if not.

return: bool If the page is subject to cascading restrictions.

areCascadeProtectionSourcesLoaded( $getPages = true )   X-Ref
Determines whether cascading protection sources have already been loaded from
the database.

param: bool $getPages True to check if the pages are loaded, or false to check
return: bool Whether or not the specified information has been loaded

getCascadeProtectionSources( $getPages = true )   X-Ref
Cascading protection: Get the source of any cascading restrictions on this page.

param: bool $getPages Whether or not to retrieve the actual pages
return: array Two elements: First is an array of Title objects of the

areRestrictionsLoaded()   X-Ref
Accessor for mRestrictionsLoaded

return: bool Whether or not the page's restrictions have already been

getRestrictions( $action )   X-Ref
Accessor/initialisation for mRestrictions

param: string $action Action that permission needs to be checked for
return: array Restriction levels needed to take the action. All levels

getAllRestrictions()   X-Ref
Accessor/initialisation for mRestrictions

return: array Keys are actions, values are arrays as returned by

getRestrictionExpiry( $action )   X-Ref
Get the expiry time for the restriction against a given action

param: string $action
return: string|bool 14-char timestamp, or 'infinity' if the page is protected forever

areRestrictionsCascading()   X-Ref
Returns cascading restrictions for the current article

return: bool

loadRestrictionsFromResultWrapper( $res, $oldFashionedRestrictions = null )   X-Ref
Loads a string into mRestrictions array

param: ResultWrapper $res Resource restrictions as an SQL result.
param: string $oldFashionedRestrictions Comma-separated list of page

loadRestrictionsFromRows( $rows, $oldFashionedRestrictions = null )   X-Ref
Compiles list of active page restrictions from both page table (pre 1.10)
and page_restrictions table for this existing page.
Public for usage by LiquidThreads.

param: array $rows Array of db result objects
param: string $oldFashionedRestrictions Comma-separated list of page

loadRestrictions( $oldFashionedRestrictions = null )   X-Ref
Load restrictions from the page_restrictions table

param: string $oldFashionedRestrictions Comma-separated list of page

flushRestrictions()   X-Ref
Flush the protection cache in this object and force reload from the database.
This is used when updating protection from WikiPage::doUpdateRestrictions().


purgeExpiredRestrictions()   X-Ref
Purge expired restrictions from the page_restrictions table


hasSubpages()   X-Ref
Does this have subpages?  (Warning, usually requires an extra DB query.)

return: bool

getSubpages( $limit = -1 )   X-Ref
Get all subpages of this page.

param: int $limit Maximum number of subpages to fetch; -1 for no limit
return: TitleArray|array TitleArray, or empty array if this page's namespace

isDeleted()   X-Ref
Is there a version of this page in the deletion archive?

return: int The number of archived revisions

isDeletedQuick()   X-Ref
Is there a version of this page in the deletion archive?

return: bool

getArticleID( $flags = 0 )   X-Ref
Get the article ID for this Title from the link cache,
adding it if necessary

param: int $flags A bit field; may be Title::GAID_FOR_UPDATE to select
return: int The ID

isRedirect( $flags = 0 )   X-Ref
Is this an article that is a redirect page?
Uses link cache, adding it if necessary

param: int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
return: bool

getLength( $flags = 0 )   X-Ref
What is the length of this page?
Uses link cache, adding it if necessary

param: int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
return: int

getLatestRevID( $flags = 0 )   X-Ref
What is the page_latest field for this page?

param: int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
return: int Int or 0 if the page doesn't exist

resetArticleID( $newid )   X-Ref
This clears some fields in this object, and clears any associated
keys in the "bad links" section of the link cache.

- This is called from WikiPage::doEdit() and WikiPage::insertOn() to allow
loading of the new page_id. It's also called from
WikiPage::doDeleteArticleReal()

param: int $newid The new Article ID

capitalize( $text, $ns = NS_MAIN )   X-Ref
Capitalize a text string for a title if it belongs to a namespace that capitalizes

param: string $text Containing title to capitalize
param: int $ns Namespace index, defaults to NS_MAIN
return: string Containing capitalized title

secureAndSplit()   X-Ref
Secure and split - main initialisation function for this object

Assumes that mDbkeyform has been set, and is urldecoded
and uses underscores, but not otherwise munged.  This function
removes illegal characters, splits off the interwiki and
namespace prefixes, sets the other forms, and canonicalizes
everything.

return: bool True on success

getLinksTo( $options = array()   X-Ref
Get an array of Title objects linking to this Title
Also stores the IDs in the link cache.

WARNING: do not use this function on arbitrary user-supplied titles!
On heavily-used templates it will max out the memory.

param: array $options May be FOR UPDATE
param: string $table Table name
param: string $prefix Fields prefix
return: Title[] Array of Title objects linking here

getTemplateLinksTo( $options = array()   X-Ref
Get an array of Title objects using this Title as a template
Also stores the IDs in the link cache.

WARNING: do not use this function on arbitrary user-supplied titles!
On heavily-used templates it will max out the memory.

param: array $options May be FOR UPDATE
return: Title[] Array of Title the Title objects linking here

getLinksFrom( $options = array()   X-Ref
Get an array of Title objects linked from this Title
Also stores the IDs in the link cache.

WARNING: do not use this function on arbitrary user-supplied titles!
On heavily-used templates it will max out the memory.

param: array $options May be FOR UPDATE
param: string $table Table name
param: string $prefix Fields prefix
return: array Array of Title objects linking here

getTemplateLinksFrom( $options = array()   X-Ref
Get an array of Title objects used on this Title as a template
Also stores the IDs in the link cache.

WARNING: do not use this function on arbitrary user-supplied titles!
On heavily-used templates it will max out the memory.

param: array $options May be FOR UPDATE
return: Title[] Array of Title the Title objects used here

getBrokenLinksFrom()   X-Ref
Get an array of Title objects referring to non-existent articles linked
from this page.

return: Title[] Array of Title the Title objects

getSquidURLs()   X-Ref
Get a list of URLs to purge from the Squid cache when this
page changes

return: string[] Array of String the URLs

purgeSquid()   X-Ref
Purge all applicable Squid URLs


moveNoAuth( &$nt )   X-Ref
Move this page without authentication

param: Title $nt The new page Title
return: array|bool True on success, getUserPermissionsErrors()-like array on failure

isValidMoveOperation( &$nt, $auth = true, $reason = '' )   X-Ref
Check whether a given move operation would be valid.
Returns true if ok, or a getUserPermissionsErrors()-like array otherwise

param: Title $nt The new title
param: bool $auth Indicates whether $wgUser's permissions
param: string $reason Is the log summary of the move, used for spam checking
return: array|bool True on success, getUserPermissionsErrors()-like array on failure

validateFileMoveOperation( $nt )   X-Ref
Check if the requested move target is a valid file move target

param: Title $nt Target title
return: array List of errors

moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true )   X-Ref
Move a title to a new location

param: Title $nt The new title
param: bool $auth Indicates whether $wgUser's permissions
param: string $reason The reason for the move
param: bool $createRedirect Whether to create a redirect from the old title to the new title.
return: array|bool True on success, getUserPermissionsErrors()-like array on failure

moveSubpages( $nt, $auth = true, $reason = '', $createRedirect = true )   X-Ref
Move this page's subpages to be subpages of $nt

param: Title $nt Move target
param: bool $auth Whether $wgUser's permissions should be checked
param: string $reason The reason for the move
param: bool $createRedirect Whether to create redirects from the old subpages to
return: array Array with old page titles as keys, and strings (new page titles) or

isSingleRevRedirect()   X-Ref
Checks if this page is just a one-rev redirect.
Adds lock, so don't use just for light purposes.

return: bool

isValidMoveTarget( $nt )   X-Ref
Checks if $this can be moved to a given Title
- Selects for update, so don't call it unless you mean business

param: Title $nt The new title to check
return: bool

getParentCategories()   X-Ref
Get categories to which this Title belongs and return an array of
categories' names.

return: array Array of parents in the form:

getParentCategoryTree( $children = array()   X-Ref
Get a tree of parent categories

param: array $children Array with the children in the keys, to check for circular refs
return: array Tree of parent categories

pageCond()   X-Ref
Get an associative array for selecting this title from
the "page" table

return: array Array suitable for the $where parameter of DB::select()

getPreviousRevisionID( $revId, $flags = 0 )   X-Ref
Get the revision ID of the previous revision

param: int $revId Revision ID. Get the revision that was before this one.
param: int $flags Title::GAID_FOR_UPDATE
return: int|bool Old revision ID, or false if none exists

getNextRevisionID( $revId, $flags = 0 )   X-Ref
Get the revision ID of the next revision

param: int $revId Revision ID. Get the revision that was after this one.
param: int $flags Title::GAID_FOR_UPDATE
return: int|bool Next revision ID, or false if none exists

getFirstRevision( $flags = 0 )   X-Ref
Get the first revision of the page

param: int $flags Title::GAID_FOR_UPDATE
return: Revision|null If page doesn't exist

getEarliestRevTime( $flags = 0 )   X-Ref
Get the oldest revision timestamp of this page

param: int $flags Title::GAID_FOR_UPDATE
return: string MW timestamp

isNewPage()   X-Ref
Check if this is a new page

return: bool

isBigDeletion()   X-Ref
Check whether the number of revisions of this page surpasses $wgDeleteRevisionsLimit

return: bool

estimateRevisionCount()   X-Ref
Get the approximate revision count of this page.

return: int

countRevisionsBetween( $old, $new, $max = null )   X-Ref
Get the number of revisions between the given revision.
Used for diffs and other things that really need it.

param: int|Revision $old Old revision or rev ID (first before range)
param: int|Revision $new New revision or rev ID (first after range)
param: int|null $max Limit of Revisions to count, will be incremented to detect truncations
return: int Number of revisions between these revisions.

getAuthorsBetween( $old, $new, $limit, $options = array()   X-Ref
Get the authors between the given revisions or revision IDs.
Used for diffs and other things that really need it.

param: int|Revision $old Old revision or rev ID (first before range by default)
param: int|Revision $new New revision or rev ID (first after range by default)
param: int $limit Maximum number of authors
param: string|array $options (Optional): Single option, or an array of options:
return: array|null Names of revision authors in the range; null if not both revisions exist

countAuthorsBetween( $old, $new, $limit, $options = array()   X-Ref
Get the number of authors between the given revisions or revision IDs.
Used for diffs and other things that really need it.

param: int|Revision $old Old revision or rev ID (first before range by default)
param: int|Revision $new New revision or rev ID (first after range by default)
param: int $limit Maximum number of authors
param: string|array $options (Optional): Single option, or an array of options:
return: int Number of revision authors in the range; zero if not both revisions exist

equals( Title $title )   X-Ref
Compare with another title.

param: Title $title
return: bool

isSubpageOf( Title $title )   X-Ref
Check if this title is a subpage of another title

param: Title $title
return: bool

exists()   X-Ref
Check if page exists.  For historical reasons, this function simply
checks for the existence of the title in the page table, and will
thus return false for interwiki links, special pages and the like.
If you want to know if a title can be meaningfully viewed, you should
probably call the isKnown() method instead.

return: bool

isAlwaysKnown()   X-Ref
Should links to this title be shown as potentially viewable (i.e. as
"bluelinks"), even if there's no record by this title in the page
table?

This function is semi-deprecated for public use, as well as somewhat
misleadingly named.  You probably just want to call isKnown(), which
calls this function internally.

(ISSUE: Most of these checks are cheap, but the file existence check
can potentially be quite expensive.  Including it here fixes a lot of
existing code, but we might want to add an optional parameter to skip
it and any other expensive checks.)

return: bool

isKnown()   X-Ref
Does this title refer to a page that can (or might) be meaningfully
viewed?  In particular, this function may be used to determine if
links to the title should be rendered as "bluelinks" (as opposed to
"redlinks" to non-existent pages).
Adding something else to this function will cause inconsistency
since LinkHolderArray calls isAlwaysKnown() and does its own
page existence check.

return: bool

hasSourceText()   X-Ref
Does this page have source text?

return: bool

getDefaultMessageText()   X-Ref
Get the default message text or false if the message doesn't exist

return: string|bool

invalidateCache()   X-Ref
Updates page_touched for this page; called from LinksUpdate.php

return: bool True if the update succeeded

touchLinks()   X-Ref
Update page_touched timestamps and send squid purge messages for
pages linking to this title. May be sent to the job queue depending
on the number of links. Typically called on create and delete.


getTouched( $db = null )   X-Ref
Get the last touched timestamp

param: DatabaseBase $db Optional db
return: string Last-touched timestamp

getNotificationTimestamp( $user = null )   X-Ref
Get the timestamp when this page was updated since the user last saw it.

param: User $user
return: string|null

getNamespaceKey( $prepend = 'nstab-' )   X-Ref
Generate strings used for xml 'id' names in monobook tabs

param: string $prepend Defaults to 'nstab-'
return: string XML 'id' name

getRedirectsHere( $ns = null )   X-Ref
Get all extant redirects to this Title

param: int|null $ns Single namespace to consider; null to consider all namespaces
return: Title[] Array of Title redirects to this title

isValidRedirectTarget()   X-Ref
Check if this Title is a valid redirect target

return: bool

getBacklinkCache()   X-Ref
Get a backlink cache object

return: BacklinkCache

canUseNoindex()   X-Ref
Whether the magic words __INDEX__ and __NOINDEX__ function for  this page.

return: bool

getCategorySortkey( $prefix = '' )   X-Ref
Returns the raw sort key to be used for categories, with the specified
prefix.  This will be fed to Collation::getSortKey() to get a
binary sortkey that can be used for actual sorting.

param: string $prefix The prefix to be used, specified using
return: string

getPageLanguage()   X-Ref
Get the language in which the content of this page is written in
wikitext. Defaults to $wgContLang, but in certain cases it can be
e.g. $wgLang (such as special pages, which are in the user language).

return: Language

getPageViewLanguage()   X-Ref
Get the language in which the content of this page is written when
viewed by user. Defaults to $wgContLang, but in certain cases it can be
e.g. $wgLang (such as special pages, which are in the user language).

return: Language

getEditNotices( $oldid = 0 )   X-Ref
Get a list of rendered edit notices for this page.

Array is keyed by the original message key, and values are rendered using parseAsBlock, so
they will already be wrapped in paragraphs.

param: int $oldid Revision ID that's being edited
return: array



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1