Title Class Reference

Represents a title within MediaWiki. More...

Inherited by FakeTitle.

List of all members.

Public Member Functions

 isLocal ()
 Determine whether the object refers to a page within this project.
 isTrans ()
 Determine whether the object refers to a page within this project and is transcludable.
 getText ()
 Simple accessors.
 getPartialURL ()
 Get the URL-encoded form of the main part.
 getDBkey ()
 Get the main part with underscores.
 getNamespace ()
 Get the namespace index, i.e. one of the NS_xxxx constants.
 getNsText ()
 Get the namespace text.
 getUserCaseDBKey ()
 Get the DB key with the initial letter case as specified by the user.
 getSubjectNsText ()
 Get the namespace text of the subject (rather than talk) page.
 getTalkNsText ()
 Get the namespace text of the talk page.
 canTalk ()
 Could this title have a corresponding talk page?
 getInterwiki ()
 Get the interwiki prefix (or null string).
 getFragment ()
 Get the Title fragment (i.e. the bit after the #) in text form.
 getFragmentForURL ()
 Get the fragment in URL form, including the "#" character if there is one.
 getDefaultNamespace ()
 Get the default namespace index, for when there is no namespace.
 getIndexTitle ()
 Get title for search index.
 getPrefixedDBkey ()
 Get the prefixed database key form.
 getPrefixedText ()
 Get the prefixed title with spaces.
 getFullText ()
 Get the prefixed title with spaces, plus any fragment (part beginning with '#').
 getBaseText ()
 Get the base name, i.e.
 getSubpageText ()
 Get the lowest-level subpage name, i.e.
 getSubpageUrlForm ()
 Get a URL-encoded form of the subpage text.
 getPrefixedURL ()
 Get a URL-encoded title (not an actual URL) including interwiki.
 getFullURL ($query= '', $variant=false)
 Get a real URL referring to this title, with interwiki link and fragment.
 getLocalURL ($query= '', $variant=false)
 Get a URL with no fragment or server name.
 getLinkUrl ($query=array(), $variant=false)
 Get a URL that's the simplest URL that will be valid to link, locally, to the current Title.
 escapeLocalURL ($query= '')
 Get an HTML-escaped version of the URL form, suitable for using in a link, without a server name or fragment.
 escapeFullURL ($query= '')
 Get an HTML-escaped version of the URL form, suitable for using in a link, including the server name and fragment.
 getInternalURL ($query= '', $variant=false)
 Get the URL form for an internal link.
 getEditURL ()
 Get the edit URL for this Title.
 getEscapedText ()
 Get the HTML-escaped displayable text form.
 isExternal ()
 Is this Title interwiki?
 isSemiProtected ($action= 'edit')
 Is this page "semi-protected" - the *only* protection is autoconfirm?
 isProtected ($action= '')
 Does the title correspond to a protected article?
 userIsWatching ()
 Is $wgUser watching this page?
 quickUserCan ($action)
 Can $wgUser perform $action on this page? This skips potentially expensive cascading permission checks.
 isNamespaceProtected ()
 Determines if $wgUser is unable to edit this page because it has been protected by $wgNamespaceProtection.
 userCan ($action, $doExpensiveQueries=true)
 Can $wgUser perform $action on this page?
 getUserPermissionsErrors ($action, $user, $doExpensiveQueries=true, $ignoreErrors=array())
 Can $user perform $action on this page?
 updateTitleProtection ($create_perm, $reason, $expiry)
 Update the title protection status.
 deleteTitleProtection ()
 Remove any title protection due to page existing.
 userCanEdit ($doExpensiveQueries=true)
 Can $wgUser edit this page?
 userCanCreate ($doExpensiveQueries=true)
 Can $wgUser create this page?
 userCanMove ($doExpensiveQueries=true)
 Can $wgUser move this page?
 isMovable ()
 Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable.
 userCanRead ()
 Can $wgUser read this page?
 isTalkPage ()
 Is this a talk page of some sort?
 isSubpage ()
 Is this a subpage?
 hasSubpages ()
 Does this have subpages? (Warning, usually requires an extra DB query.
 getSubpages ($limit=-1)
 Get all subpages of this page.
 isCssOrJsPage ()
 Could this page contain custom CSS or JavaScript, based on the title?
 isCssJsSubpage ()
 Is this a .css or .js subpage of a user page?
 isValidCssJsSubpage ()
 Is this a *valid* .css or .js subpage of a user page? Check that the corresponding skin exists.
 getSkinFromCssJsSubpage ()
 Trim down a .css or .js subpage title to get the corresponding skin name.
 isCssSubpage ()
 Is this a .css subpage of a user page?
 isJsSubpage ()
 Is this a .js subpage of a user page?
 userCanEditCssJsSubpage ()
 Protect css/js subpages of user pages: can $wgUser edit this page?
 isCascadeProtected ()
 Cascading protection: Return true if cascading restrictions apply to this page, false if not.
 getCascadeProtectionSources ($get_pages=true)
 Cascading protection: Get the source of any cascading restrictions on this page.
 areRestrictionsCascading ()
 loadRestrictions ($oldFashionedRestrictions=NULL)
 Load restrictions from the page_restrictions table.
 getRestrictions ($action)
 Accessor/initialisation for mRestrictions.
 getRestrictionExpiry ($action)
 Get the expiry time for the restriction against a given action.
 isDeleted ()
 Is there a version of this page in the deletion archive?
 isDeletedQuick ()
 Is there a version of this page in the deletion archive?
 getArticleID ($flags=0)
 Get the article ID for this Title from the link cache, adding it if necessary.
 isRedirect ($flags=0)
 Is this an article that is a redirect page? Uses link cache, adding it if necessary.
 getLength ($flags=0)
 What is the length of this page? Uses link cache, adding it if necessary.
 getLatestRevID ($flags=0)
 What is the page_latest field for this page?
 resetArticleID ($newid)
 This clears some fields in this object, and clears any associated keys in the "bad links" section of the link cache.
 invalidateCache ()
 Updates page_touched for this page; called from LinksUpdate.php.
 prefix ($name)
 Prefix some arbitrary text with the namespace or interwiki prefix of this object.
 setFragment ($fragment)
 Set the fragment for this title.
 getTalkPage ()
 Get a Title object associated with the talk page of this article.
 getSubjectPage ()
 Get a title object associated with the subject page of this talk page.
 getLinksTo ($options=array(), $table= 'pagelinks', $prefix= 'pl')
 Get an array of Title objects linking to this Title Also stores the IDs in the link cache.
 getTemplateLinksTo ($options=array())
 Get an array of Title objects using this Title as a template Also stores the IDs in the link cache.
 getBrokenLinksFrom ()
 Get an array of Title objects referring to non-existent articles linked from this page.
 getSquidURLs ()
 Get a list of URLs to purge from the Squid cache when this page changes.
 purgeSquid ()
 Purge all applicable Squid URLs.
 moveNoAuth (&$nt)
 Move this page without authentication.
 isValidMoveOperation (&$nt, $auth=true, $reason= '')
 Check whether a given move operation would be valid.
 moveTo (&$nt, $auth=true, $reason= '', $createRedirect=true)
 Move a title to a new location.
 moveSubpages ($nt, $auth=true, $reason= '', $createRedirect=true)
 Move this page's subpages to be subpages of $nt.
 isSingleRevRedirect ()
 Checks if this page is just a one-rev redirect.
 isValidMoveTarget ($nt)
 Checks if $this can be moved to a given Title
  • Selects for update, so don't call it unless you mean business.

 isWatchable ()
 Can this title be added to a user's watchlist?
 getParentCategories ()
 Get categories to which this Title belongs and return an array of categories' names.
 getParentCategoryTree ($children=array())
 Get a tree of parent categories.
 pageCond ()
 Get an associative array for selecting this title from the "page" table.
 getPreviousRevisionID ($revId, $flags=0)
 Get the revision ID of the previous revision.
 getNextRevisionID ($revId, $flags=0)
 Get the revision ID of the next revision.
 getFirstRevision ($flags=0)
 Get the first revision of the page.
 isNewPage ()
 Check if this is a new page.
 getEarliestRevTime ()
 Get the oldest revision timestamp of this page.
 countRevisionsBetween ($old, $new)
 Get the number of revisions between the given revision IDs.
 equals (Title $title)
 Compare with another title.
 __toString ()
 Return a string representation of this title.
 exists ()
 Check if page exists.
 isAlwaysKnown ()
 Should links to this title be shown as potentially viewable (i.e.
 isKnown ()
 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).
 canExist ()
 Is this in a namespace that allows actual pages?
 touchLinks ()
 Update page_touched timestamps and send squid purge messages for pages linking to this title.
 getTouched ($db=NULL)
 Get the last touched timestamp.
 getNotificationTimestamp ($user=NULL)
 Get the timestamp when this page was updated since the user last saw it.
 trackbackURL ()
 Get the trackback URL for this page.
 trackbackRDF ()
 Get the trackback RDF for this page.
 getNamespaceKey ()
 Generate strings used for xml 'id' names in monobook tabs.
 isSpecial ($name)
 Returns true if this title resolves to the named special page.
 fixSpecialName ()
 If the Title refers to a special page alias which is not the local default,.
 isContentPage ()
 Is this Title in a namespace which contains content? In other words, is this a content page, for the purposes of calculating statistics, etc?
 getRedirectsHere ($ns=null)
 Get all extant redirects to this Title.
 isValidRedirectTarget ()
 Check if this Title is a valid redirect target.
 getBacklinkCache ()
 Get a backlink cache object.

Static Public Member Functions

static newFromDBkey ($key)
 Create a new Title from a prefixed DB key.
static newFromText ($text, $defaultNamespace=NS_MAIN)
 Create a new Title from text, such as what one would find in a link.
static newFromURL ($url)
 Create a new Title from URL-encoded text.
static newFromID ($id, $flags=0)
 Create a new Title from an article ID.
static newFromIDs ($ids)
 Make an array of titles from an array of IDs.
static newFromRow ($row)
 Make a Title object from a DB row.
static & makeTitle ($ns, $title, $fragment= '')
 Create a new Title from a namespace index and a DB key.
static makeTitleSafe ($ns, $title, $fragment= '')
 Create a new Title from a namespace index and a DB key.
static newMainPage ()
 Create a new Title for the Main Page.
static newFromRedirect ($text)
 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.
static newFromRedirectRecurse ($text)
 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.
static newFromRedirectArray ($text)
 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).
static nameOf ($id)
 Get the prefixed DB key associated with an ID.
static legalChars ()
 Get a regex character class describing the legal characters in a link.
static indexTitle ($ns, $title)
 Get a string representation of a title suitable for including in a search index.
static makeName ($ns, $title, $fragment= '')
 getInterwikiLink ($key)
 Returns the URL associated with an interwiki prefix.
static escapeFragmentForURL ($fragment)
 Escape a text fragment, say from a link, for a URL.
static purgeExpiredRestrictions ()
 Purge expired restrictions from the page_restrictions table.
static compare ($a, $b)
 Callback for usort() to do title sorts by (namespace, title).

Public Attributes

const CACHE_MAX = 1000
 Title::newFromText maintains a cache to avoid expensive re-normalization of commonly used titles.
Private member variables
Please use the accessor functions instead.

Access:
private


 $mTextform = ''
 Text form (spaces not underscores) of the main part.
 $mUrlform = ''
 URL-encoded form of the main part.
 $mDbkeyform = ''
 Main part with underscores.
 $mUserCaseDBKey
 DB key with the initial letter in the case specified by the user.
 $mNamespace = NS_MAIN
 Namespace index, i.e. one of the NS_xxxx constants.
 $mInterwiki = ''
 Interwiki prefix (or null string).
 $mFragment
 Title fragment (i.e. the bit after the #).
 $mArticleID = -1
 Article ID, fetched from the link cache on demand.
 $mLatestID = false
 ID of most recent revision.
 $mRestrictions = array()
 Array of groups allowed to edit this article.
 $mOldRestrictions = false
 Text form (spaces not underscores) of the main part.
 $mCascadeRestriction
 Cascade restrictions on this page to included templates and images?
 $mRestrictionsExpiry = array()
 When do the restrictions on this page expire?
 $mHasCascadingRestrictions
 Are cascading restrictions in effect on this page?
 $mCascadeSources
 Where are the cascading restrictions coming from on this page?
 $mRestrictionsLoaded = false
 Boolean for initialisation on demand.
 $mPrefixedText
 Text form including namespace/interwiki, initialised on demand.
 $mDefaultNamespace = NS_MAIN
 Namespace index when there is no namespace.
 $mWatched = null
 Is $wgUser watching this page? null if unfilled, accessed through userIsWatching().
 $mLength = -1
 The page length, 0 for special pages.
 $mRedirect = null
 Is the article at this title a redirect?
 $mNotificationTimestamp = array()
 Associative array of user ID -> timestamp/false.
 $mBacklinkCache = null
 Cache of links to this title.

Static Protected Member Functions

static newFromRedirectInternal ($text)
 Really extract the redirect destination Do not call this function directly, use one of the newFromRedirect* functions above.

Private Member Functions

 __construct ()
 Constructor.
 getUserPermissionsErrorsInternal ($action, $user, $doExpensiveQueries=true, $short=false)
 Can $user perform $action on this page? This is an internal function, which checks ONLY that previously checked by userCan (i.e.
 getTitleProtection ()
 Is this title subject to title protection?
 loadRestrictionsFromRow ($res, $oldFashionedRestrictions=NULL)
 Loads a string into mRestrictions array.
 secureAndSplit ()
 Secure and split - main initialisation function for this object.
 moveOverExistingRedirect (&$nt, $reason= '', $createRedirect=true)
 Move page to a title which is at present a redirect to the source page.
 moveToNewTitle (&$nt, $reason= '', $createRedirect=true)
 Move page to non-existing title.

Static Private Attributes

Static cache variables
static $titleCache = array()
static $interwikiCache = array()


Detailed Description

Represents a title within MediaWiki.

Optionally may contain an interwiki designation or namespace.

Note:
This class can fetch various kinds of data from the database; however, it does so inefficiently.

Definition at line 25 of file Title.php.


Constructor & Destructor Documentation

Title::__construct (  )  [private]

Constructor.

Definition at line 80 of file Title.php.


Member Function Documentation

Title::__toString (  ) 

Return a string representation of this title.

Returns:
String : : String representation of this title

Definition at line 3357 of file Title.php.

References getPrefixedText().

Title::areRestrictionsCascading (  ) 

Definition at line 1817 of file Title.php.

References loadRestrictions().

Title::canExist (  ) 

Is this in a namespace that allows actual pages?

Returns:
Boolean : : TRUE or FALSE

Definition at line 3432 of file Title.php.

Title::canTalk (  ) 

Could this title have a corresponding talk page?

Returns:
Boolean : : TRUE or FALSE

Definition at line 600 of file Title.php.

References MWNamespace::canTalk().

static Title::compare ( a,
b 
) [static]

Callback for usort() to do title sorts by (namespace, title).

Definition at line 3344 of file Title.php.

Referenced by ApiQueryInfo::execute().

Title::countRevisionsBetween ( old,
new 
)

Get the number of revisions between the given revision IDs.

Used for diffs and other things that really need it.

Parameters:
$old  Integer : : Revision ID.
$new  Integer : : Revision ID.
Returns:
Integer : : Number of revisions between these IDs.

Definition at line 3318 of file Title.php.

References $dbr, and wfGetDB().

Title::deleteTitleProtection (  ) 

Remove any title protection due to page existing.

Definition at line 1460 of file Title.php.

References $dbw, getDBkey(), getNamespace(), and wfGetDB().

Title::equals ( Title title  ) 

Compare with another title.

Parameters:
<b> Title : $title
Returns:
Boolean : : TRUE or FALSE

Definition at line 3334 of file Title.php.

References getDBkey(), getInterwiki(), and getNamespace().

Referenced by Parser::getTemplateDom(), and isValidMoveOperation().

static Title::escapeFragmentForURL ( fragment  )  [static]

Escape a text fragment, say from a link, for a URL.

Definition at line 518 of file Title.php.

References $wgEnforceHtmlIds, and Sanitizer::escapeId().

Referenced by getFragmentForURL().

Title::escapeFullURL ( query = ''  ) 

Get an HTML-escaped version of the URL form, suitable for using in a link, including the server name and fragment.

Parameters:
$query  String : : an optional query string
Returns:
String : : the URL

Reimplemented in FakeTitle.

Definition at line 904 of file Title.php.

References getFullURL().

Title::escapeLocalURL ( query = ''  ) 

Get an HTML-escaped version of the URL form, suitable for using in a link, without a server name or fragment.

Parameters:
$query  String : : an optional query string
Returns:
String : : the URL

Reimplemented in FakeTitle.

Definition at line 893 of file Title.php.

References getLocalURL().

Title::exists (  ) 

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.

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 3370 of file Title.php.

Referenced by getEarliestRevTime(), isAlwaysKnown(), isKnown(), isSemiProtected(), isValidMoveOperation(), and loadRestrictions().

Title::fixSpecialName (  ) 

If the Title refers to a special page alias which is not the local default,.

Returns:
Title : A new Title which points to the local default. Otherwise, returns $this.

Definition at line 3591 of file Title.php.

References SpecialPage::getLocalNameFor(), getNamespace(), makeTitle(), and SpecialPage::resolveAlias().

Title::getArticleID ( flags = 0  ) 

Get the article ID for this Title from the link cache, adding it if necessary.

Parameters:
$flags  Integer : : a bit field; may be GAID_FOR_UPDATE to select for update
Returns:
Integer : : the ID

Reimplemented in FakeTitle.

Definition at line 2029 of file Title.php.

References $flags, getNamespace(), and LinkCache::singleton().

Referenced by getLength(), isRedirect(), isValidMoveOperation(), moveOverExistingRedirect(), moveTo(), moveToNewTitle(), and Parser::statelessFetchTemplate().

Title::getBacklinkCache (  ) 

Get a backlink cache object.

Definition at line 3672 of file Title.php.

Title::getBaseText (  ) 

Get the base name, i.e.

the leftmost parts before the /

Returns:
String : : Base name

Definition at line 682 of file Title.php.

References getText(), and MWNamespace::hasSubpages().

Title::getBrokenLinksFrom (  ) 

Get an array of Title objects referring to non-existent articles linked from this page.

Todo:
check if needed (used only in SpecialBrokenRedirects.php, and should use redirect table in this case)
Returns:
{Title} : the Title objects

Reimplemented in FakeTitle.

Definition at line 2474 of file Title.php.

References $dbr, $res, $row, makeTitle(), and wfGetDB().

Title::getCascadeProtectionSources ( get_pages = true  ) 

Cascading protection: Get the source of any cascading restrictions on this page.

Parameters:
$get_pages  Boolean : : Whether or not to retrieve the actual pages that the restrictions have come from.
Returns:
{ Array of restriction array} Array of the Title objects of the pages from which cascading restrictions have come, false for none, or true if such restrictions exist, but $get_pages was not set. The restriction array is an array of each type, each of which contains an array of unique groups.

Definition at line 1734 of file Title.php.

References $action, $dbr, $res, $row, $wgRestrictionTypes, Block::decodeExpiry(), getDBkey(), getNamespace(), makeTitle(), purgeExpiredRestrictions(), wfGetDB(), wfProfileIn(), wfProfileOut(), and wfTimestampNow().

Referenced by getUserPermissionsErrorsInternal(), and isCascadeProtected().

Title::getDBkey (  ) 

Title::getDefaultNamespace (  ) 

Get the default namespace index, for when there is no namespace.

Returns:
Integer : : Default namespace index

Reimplemented in FakeTitle.

Definition at line 628 of file Title.php.

Title::getEarliestRevTime (  ) 

Get the oldest revision timestamp of this page.

Returns:
string, MW timestamp

Definition at line 3298 of file Title.php.

References $dbr, exists(), wfGetDB(), and wfTimestampOrNull().

Title::getEditURL (  ) 

Get the edit URL for this Title.

Returns:
String : : the URL, or a null string if this is an interwiki link

Reimplemented in FakeTitle.

Definition at line 929 of file Title.php.

References $s, and getLocalURL().

Title::getEscapedText (  ) 

Get the HTML-escaped displayable text form.

Used for the title field in tags.

Returns:
String : : the text, including any prefixes

Reimplemented in FakeTitle.

Definition at line 941 of file Title.php.

References getPrefixedText().

Title::getFirstRevision ( flags = 0  ) 

Get the first revision of the page.

Parameters:
$flags  Integer : : GAID_FOR_UPDATE
Returns:
Revision (or NULL if page doesn't exist)

Definition at line 3267 of file Title.php.

References $db, $flags, $row, and wfGetDB().

Title::getFragment (  ) 

Get the Title fragment (i.e. the bit after the #) in text form.

Returns:
String : : Title fragment

Reimplemented in FakeTitle.

Definition at line 612 of file Title.php.

Referenced by getLinkUrl(), and Linker::normaliseSpecialPage().

Title::getFragmentForURL (  ) 

Get the fragment in URL form, including the "#" character if there is one.

Returns:
String : : Fragment in URL form

Definition at line 617 of file Title.php.

References escapeFragmentForURL().

Referenced by getFullURL(), and getLinkUrl().

Title::getFullText (  ) 

Get the prefixed title with spaces, plus any fragment (part beginning with '#').

Returns:
String : : the prefixed title, with spaces and the fragment, including '#'

Reimplemented in FakeTitle.

Definition at line 670 of file Title.php.

References $text, and getPrefixedText().

Referenced by getParentCategories().

Title::getFullURL ( query = '',
variant = false 
)

Get a real URL referring to this title, with interwiki link and fragment.

Parameters:
$query { String :,} an optional query string, not used for interwiki links. Can be specified as an associative array as well, e.g., array( 'action' => 'edit' ) (keys and values will be URL-escaped).
$variant  String : : language variant of url (for sr, zh..)
Returns:
String : : the URL

Reimplemented in FakeTitle.

Definition at line 736 of file Title.php.

References $url, $wgContLang, $wgRequest, $wgServer, Interwiki::fetch(), getFragmentForURL(), getNsText(), wfAppendQuery(), wfArrayToCGI(), wfRunHooks(), and wfUrlencode().

Referenced by escapeFullURL(), getLinkUrl(), getLocalURL(), and trackbackRDF().

Title::getIndexTitle (  ) 

Get title for search index.

Returns:
String : : a stripped-down title string ready for the search index

Reimplemented in FakeTitle.

Definition at line 635 of file Title.php.

References indexTitle().

Title::getInternalURL ( query = '',
variant = false 
)

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.

Parameters:
$query  String : : an optional query string
$variant  String : : language variant of url (for sr, zh..)
Returns:
String : : the URL

Reimplemented in FakeTitle.

Definition at line 917 of file Title.php.

References $url, $wgInternalServer, getLocalURL(), and wfRunHooks().

Referenced by getSquidURLs().

Title::getInterwiki (  ) 

Get the interwiki prefix (or null string).

Returns:
String : : Interwiki prefix

Reimplemented in FakeTitle.

Definition at line 607 of file Title.php.

Referenced by equals(), and isMovable().

Title::getInterwikiLink ( key  )  [static]

Returns the URL associated with an interwiki prefix.

Parameters:
$key  String : : the interwiki prefix (e.g. "MeatBall")
Returns:
String : : the associated URL, containing "$1", which should be replaced by an article title (arguably)
Deprecated:
See Interwiki class

Definition at line 483 of file Title.php.

References $key, and Interwiki::fetch().

Title::getLatestRevID ( flags = 0  ) 

What is the page_latest field for this page?

Parameters:
$flags  Integer : : a bit field; may be GAID_FOR_UPDATE to select for update
Returns:
Integer : :

Definition at line 2090 of file Title.php.

References $db, $flags, pageCond(), and wfGetDB().

Referenced by moveOverExistingRedirect().

Title::getLength ( flags = 0  ) 

What is the length of this page? Uses link cache, adding it if necessary.

Parameters:
$flags  Integer : : a bit field; may be GAID_FOR_UPDATE to select for update
Returns:
Boolean : :

Definition at line 2072 of file Title.php.

References $flags, getArticleID(), and LinkCache::singleton().

Title::getLinksTo ( options = array(),
table = 'pagelinks',
prefix = 'pl' 
)

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.

Parameters:
array $options may be FOR UPDATE
Returns:
{Title} : the Title objects linking here

Definition at line 2423 of file Title.php.

References $db, $options, $res, $row, getDBkey(), getNamespace(), makeTitle(), LinkCache::singleton(), and wfGetDB().

Referenced by getTemplateLinksTo().

Title::getLinkUrl ( query = array(),
variant = false 
)

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.

Parameters:
$query  { String :} : An associative array of key => value pairs for the query string. Keys and values will be escaped.
$variant  String : : Language variant of URL (for sr, zh..). Ignored for external links. Default is "false" (same variant as current page, for anonymous users).
Returns:
String : : the URL

Definition at line 869 of file Title.php.

References getFragment(), getFragmentForURL(), getFullURL(), getLocalURL(), getPrefixedText(), isExternal(), wfProfileIn(), and wfProfileOut().

Title::getLocalURL ( query = '',
variant = false 
)

Get a URL with no fragment or server name.

If this page is generated with action=render, $wgServer is prepended.

Parameters:
mixed $query an optional query string; if not specified, $wgArticlePath will be used. Can be specified as an associative array as well, e.g., array( 'action' => 'edit' ) (keys and values will be URL-escaped).
$variant  String : : language variant of url (for sr, zh..)
Returns:
String : : the URL

Reimplemented in FakeTitle.

Definition at line 782 of file Title.php.

References $action, $url, $wgActionPaths, $wgArticlePath, $wgContLang, $wgRequest, $wgScript, $wgServer, $wgUser, $wgVariantArticlePath, getFullURL(), getPrefixedDBkey(), isExternal(), wfAppendQuery(), wfArrayToCGI(), wfRunHooks(), and wfUrlencode().

Referenced by escapeLocalURL(), getEditURL(), getInternalURL(), getLinkUrl(), and Linker::makeThumbLink2().

Title::getNamespace (  ) 

Title::getNamespaceKey (  ) 

Generate strings used for xml 'id' names in monobook tabs.

Returns:
String : : XML 'id' name

Definition at line 3537 of file Title.php.

References $wgContLang, getNamespace(), and getSubjectNsText().

Title::getNextRevisionID ( revId,
flags = 0 
)

Get the revision ID of the next revision.

Parameters:
$revId  Integer : : Revision ID. Get the revision that was after this one.
$flags  Integer : : GAID_FOR_UPDATE
Returns:
{ Integer :, Boolean :} Next revision ID, or FALSE if none exists

Definition at line 3249 of file Title.php.

References $db, $flags, and wfGetDB().

Title::getNotificationTimestamp ( user = NULL  ) 

Get the timestamp when this page was updated since the user last saw it.

Parameters:
User $user
Returns:
mixed string/NULL

Definition at line 3467 of file Title.php.

References $dbr, $user, $wgShowUpdatedMarker, $wgUser, getDBkey(), getNamespace(), and wfGetDB().

Title::getNsText (  ) 

Get the namespace text.

Returns:
{} Namespace text

Reimplemented in FakeTitle.

Definition at line 557 of file Title.php.

References $wgCanonicalNamespaceNames, and $wgContLang.

Referenced by getFullURL(), getUserPermissionsErrorsInternal(), isValidMoveOperation(), and prefix().

Title::getParentCategories (  ) 

Get categories to which this Title belongs and return an array of categories' names.

Returns:
: array an array of parents in the form: $parent => $currentarticle

Reimplemented in FakeTitle.

Definition at line 3154 of file Title.php.

References $dbr, $res, $row, $sql, $wgContLang, getFullText(), and wfGetDB().

Referenced by getParentCategoryTree().

Title::getParentCategoryTree ( children = array()  ) 

Get a tree of parent categories.

Parameters:
$children  : an array with the children in the keys, to check for circular refs
Returns:
: Tree of parent categories

Definition at line 3185 of file Title.php.

References getParentCategories(), and newFromText().

Title::getPartialURL (  ) 

Get the URL-encoded form of the main part.

Returns:
{} Main part of the title, URL-encoded

Reimplemented in FakeTitle.

Definition at line 542 of file Title.php.

Title::getPrefixedDBkey (  ) 

Get the prefixed database key form.

Returns:
String : : the prefixed title, with underscores and any interwiki and namespace prefixes

Reimplemented in FakeTitle.

Definition at line 644 of file Title.php.

References $s, and prefix().

Referenced by getLocalURL(), Parser::getTemplateDom(), isValidMoveTarget(), Linker::makeImageLink2(), moveTo(), resetArticleID(), and trackbackURL().

Title::getPrefixedText (  ) 

Get the prefixed title with spaces.

This is the form usually used for display

Returns:
String : : the prefixed title, with spaces

Reimplemented in FakeTitle.

Definition at line 655 of file Title.php.

References $s, and prefix().

Referenced by __toString(), Linker::buildRollbackLink(), getEscapedText(), getFullText(), getLinkUrl(), Linker::makeBrokenImageLinkObj(), moveOverExistingRedirect(), moveTo(), moveToNewTitle(), and userCanRead().

Title::getPrefixedURL (  ) 

Get a URL-encoded title (not an actual URL) including interwiki.

Returns:
String : : the URL-encoded form

Reimplemented in FakeTitle.

Definition at line 720 of file Title.php.

References $s, prefix(), and wfUrlencode().

Title::getPreviousRevisionID ( revId,
flags = 0 
)

Get the revision ID of the previous revision.

Parameters:
$revId  Integer : : Revision ID. Get the revision that was before this one.
$flags  Integer : : GAID_FOR_UPDATE
Returns:
{ Integer :, Boolean :} Old revision ID, or FALSE if none exists

Definition at line 3230 of file Title.php.

References $db, $flags, and wfGetDB().

Title::getRedirectsHere ( ns = null  ) 

Get all extant redirects to this Title.

Parameters:
$ns { Integer :, Null :} Single namespace to consider; NULL to consider all namespaces
Returns:
{Title} : Redirects to this title

Definition at line 3622 of file Title.php.

References $dbr, $ns, $res, $row, getDBkey(), getNamespace(), newFromRow(), and wfGetDB().

Title::getRestrictionExpiry ( action  ) 

Get the expiry time for the restriction against a given action.

Returns:
14-char timestamp, or 'infinity' if the page is protected forever or not protected at all, or false if the action is not recognised.

Definition at line 1970 of file Title.php.

References $action, and loadRestrictions().

Title::getRestrictions ( action  ) 

Accessor/initialisation for mRestrictions.

Parameters:
$action  String : : action that permission needs to be checked for
Returns:
{ String :} : the array of groups allowed to edit this article

Reimplemented in FakeTitle.

Definition at line 1956 of file Title.php.

References $action, and loadRestrictions().

Referenced by getUserPermissionsErrorsInternal(), isProtected(), isSemiProtected(), and updateTitleProtection().

Title::getSkinFromCssJsSubpage (  ) 

Trim down a .css or .js subpage title to get the corresponding skin name.

Reimplemented in FakeTitle.

Definition at line 1685 of file Title.php.

Referenced by isValidCssJsSubpage().

Title::getSquidURLs (  ) 

Get a list of URLs to purge from the Squid cache when this page changes.

Returns:
{ String :} : the URLs

Reimplemented in FakeTitle.

Definition at line 2511 of file Title.php.

References $urls, $wgContLang, and getInternalURL().

Referenced by moveOverExistingRedirect(), and purgeSquid().

Title::getSubjectNsText (  ) 

Get the namespace text of the subject (rather than talk) page.

Returns:
String : : Namespace text

Reimplemented in FakeTitle.

Definition at line 584 of file Title.php.

References $wgContLang, and MWNamespace::getSubject().

Referenced by getNamespaceKey().

Title::getSubjectPage (  ) 

Get a title object associated with the subject page of this talk page.

Returns:
Title : the object for the subject page

Reimplemented in FakeTitle.

Definition at line 2404 of file Title.php.

References getDBkey(), getNamespace(), MWNamespace::getSubject(), and makeTitle().

Title::getSubpages ( limit = -1  ) 

Get all subpages of this page.

Parameters:
$limit Maximum number of subpages to fetch; -1 for no limit
Returns:
mixed TitleArray, or empty array if this page's namespace doesn't allow subpages

Definition at line 1630 of file Title.php.

References $conds, $dbr, $options, getNamespace(), MWNamespace::hasSubpages(), TitleArray::newFromResult(), and wfGetDB().

Referenced by hasSubpages(), and moveSubpages().

Title::getSubpageText (  ) 

Get the lowest-level subpage name, i.e.

the rightmost part after /

Returns:
String : : Subpage name

Definition at line 698 of file Title.php.

References MWNamespace::hasSubpages().

Referenced by getSubpageUrlForm().

Title::getSubpageUrlForm (  ) 

Get a URL-encoded form of the subpage text.

Returns:
String : : URL-encoded subpage name

Definition at line 710 of file Title.php.

References $text, getSubpageText(), and wfUrlencode().

Title::getTalkNsText (  ) 

Get the namespace text of the talk page.

Returns:
String : : Namespace text

Definition at line 592 of file Title.php.

References $wgContLang, and MWNamespace::getTalk().

Title::getTalkPage (  ) 

Get a Title object associated with the talk page of this article.

Returns:
Title : the object for the talk page

Reimplemented in FakeTitle.

Definition at line 2394 of file Title.php.

References getDBkey(), getNamespace(), MWNamespace::getTalk(), and makeTitle().

Title::getTemplateLinksTo ( options = array()  ) 

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.

Parameters:
array $options may be FOR UPDATE
Returns:
{Title} : the Title objects linking here

Definition at line 2464 of file Title.php.

References $options, and getLinksTo().

Title::getText (  ) 

Simple accessors.

Get the text form (spaces not underscores) of the main part

Returns:
{} Main part of the title

Reimplemented in FakeTitle.

Definition at line 537 of file Title.php.

Referenced by getBaseText(), isSubpage(), Linker::makeMediaLinkObj(), Parser::statelessFetchTemplate(), and trackbackRDF().

Title::getTitleProtection (  )  [private]

Is this title subject to title protection?

Returns:
{} An associative array representing any existent title protection, or false if there's none.

Definition at line 1385 of file Title.php.

References $dbr, $res, $row, getDBkey(), getNamespace(), and wfGetDB().

Referenced by getUserPermissionsErrorsInternal(), and loadRestrictions().

Title::getTouched ( db = NULL  ) 

Get the last touched timestamp.

Parameters:
Database $db, optional db
Returns:
String : : Last touched timestamp

Definition at line 3456 of file Title.php.

References $db, pageCond(), and wfGetDB().

Title::getUserCaseDBKey (  ) 

Get the DB key with the initial letter case as specified by the user.

Returns:
String : : DB key

Definition at line 577 of file Title.php.

Title::getUserPermissionsErrors ( action,
user,
doExpensiveQueries = true,
ignoreErrors = array() 
)

Can $user perform $action on this page?

FIXME: This *does not* check throttles (User::pingLimiter()).

Parameters:
$action  String : :action that permission needs to be checked for
$user  User : user to check
$doExpensiveQueries  Boolean : : Set this to false to avoid doing unnecessary queries.
$ignoreErrors  { String :} : Set this to a list of message keys whose corresponding errors may be ignored.
Returns:
: Array of arrays of the arguments to wfMsg to explain permissions problems.

Definition at line 1076 of file Title.php.

References $action, $error, $name, $reason, $user, $wgContLang, $wgEmailConfirmToEdit, $wgLang, $wgUser, getUserPermissionsErrorsInternal(), StubObject::isRealObject(), wfGetIP(), wfMsg(), wfTimestamp(), and User::whoIs().

Referenced by getUserPermissionsErrorsInternal(), and isValidMoveOperation().

Title::getUserPermissionsErrorsInternal ( action,
user,
doExpensiveQueries = true,
short = false 
) [private]

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)

Parameters:
$action  String : : action that permission needs to be checked for
$user  User : user to check
$doExpensiveQueries  Boolean : : Set this to false to avoid doing unnecessary queries.
$short  Boolean : : Set this to true to stop after the first permission error.
Returns:
: Array of arrays of the arguments to wfMsg to explain permissions problems.

Definition at line 1167 of file Title.php.

References $action, $ns, $page, $result, $user, getCascadeProtectionSources(), User::getGroupsWithPermission(), getNamespace(), getNsText(), getRestrictions(), getTitleProtection(), getUserPermissionsErrors(), isCssJsSubpage(), isMovable(), MWNamespace::isMovable(), isNamespaceProtected(), isSubpage(), isTalkPage(), wfMsg(), wfProfileIn(), wfProfileOut(), wfRunHooks(), and User::whoIs().

Referenced by getUserPermissionsErrors(), and userCan().

Title::hasSubpages (  ) 

Does this have subpages? (Warning, usually requires an extra DB query.

)

Returns:
Boolean : : TRUE or FALSE

Definition at line 1604 of file Title.php.

References getSubpages(), and MWNamespace::hasSubpages().

Referenced by isSubpage().

static Title::indexTitle ( ns,
title 
) [static]

Get a string representation of a title suitable for including in a search index.

Parameters:
$ns  Integer : : a namespace index
$title  String : : text-form main part
Returns:
String : : a stripped-down title string ready for the search index

Definition at line 437 of file Title.php.

References $ns, $t, $title, $wgContLang, and SearchEngine::legalSearchChars().

Referenced by SearchUpdate::doUpdate(), and getIndexTitle().

Title::invalidateCache (  ) 

Updates page_touched for this page; called from LinksUpdate.php.

Returns:
Boolean : : true if the update succeded

Reimplemented in FakeTitle.

Definition at line 2123 of file Title.php.

References $dbw, $success, HTMLFileCache::clearFileCache(), pageCond(), wfGetDB(), and wfReadOnly().

Title::isAlwaysKnown (  ) 

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

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 3390 of file Title.php.

References exists(), wfFindFile(), and wfMsgWeirdKey().

Referenced by isKnown().

Title::isCascadeProtected (  ) 

Cascading protection: Return true if cascading restrictions apply to this page, false if not.

Returns:
Boolean : : If the page is subject to cascading restrictions.

Definition at line 1721 of file Title.php.

References getCascadeProtectionSources().

Title::isContentPage (  ) 

Is this Title in a namespace which contains content? In other words, is this a content page, for the purposes of calculating statistics, etc?

Returns:
Boolean : : TRUE or FALSE

Definition at line 3611 of file Title.php.

References getNamespace(), and MWNamespace::isContent().

Referenced by moveTo().

Title::isCssJsSubpage (  ) 

Is this a .css or .js subpage of a user page?

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1666 of file Title.php.

Referenced by getUserPermissionsErrorsInternal(), and isValidCssJsSubpage().

Title::isCssOrJsPage (  ) 

Could this page contain custom CSS or JavaScript, based on the title?

Returns:
Boolean : : TRUE or FALSE

Definition at line 1657 of file Title.php.

Title::isCssSubpage (  ) 

Is this a .css subpage of a user page?

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1694 of file Title.php.

Title::isDeleted (  ) 

Is there a version of this page in the deletion archive?

Returns:
Integer : : the number of archived revisions

Reimplemented in FakeTitle.

Definition at line 1981 of file Title.php.

References $dbr, $n, getDBkey(), getNamespace(), and wfGetDB().

Title::isDeletedQuick (  ) 

Is there a version of this page in the deletion archive?

Returns:
bool

Definition at line 2004 of file Title.php.

References $dbr, getDBkey(), getNamespace(), and wfGetDB().

Title::isExternal (  ) 

Is this Title interwiki?

Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 949 of file Title.php.

Referenced by getLinkUrl(), getLocalURL(), and isWatchable().

Title::isJsSubpage (  ) 

Is this a .js subpage of a user page?

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1701 of file Title.php.

Title::isKnown (  ) 

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

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 3423 of file Title.php.

References exists(), and isAlwaysKnown().

Title::isLocal (  ) 

Determine whether the object refers to a page within this project.

Returns:
Boolean : : TRUE if this is an in-project interwiki link or a wikilink, FALSE otherwise

Reimplemented in FakeTitle.

Definition at line 494 of file Title.php.

References Interwiki::fetch().

Title::isMovable (  ) 

Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable.

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1501 of file Title.php.

References getInterwiki(), and getNamespace().

Referenced by getUserPermissionsErrorsInternal(), and isValidMoveOperation().

Title::isNamespaceProtected (  ) 

Determines if $wgUser is unable to edit this page because it has been protected by $wgNamespaceProtection.

Returns:
Boolean : :

Definition at line 1043 of file Title.php.

References $wgNamespaceProtection, and $wgUser.

Referenced by getUserPermissionsErrorsInternal().

Title::isNewPage (  ) 

Check if this is a new page.

Returns:
bool

Definition at line 3288 of file Title.php.

References $dbr, pageCond(), and wfGetDB().

Title::isProtected ( action = ''  ) 

Does the title correspond to a protected article?

Parameters:
$what  String : : the action the page is protected from, by default checks move and edit
Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 982 of file Title.php.

References $action, $type, $wgRestrictionLevels, $wgRestrictionTypes, getNamespace(), and getRestrictions().

Referenced by moveTo().

Title::isRedirect ( flags = 0  ) 

Is this an article that is a redirect page? Uses link cache, adding it if necessary.

Parameters:
$flags  Integer : : a bit field; may be GAID_FOR_UPDATE to select for update
Returns:
Boolean : :

Definition at line 2053 of file Title.php.

References $flags, getArticleID(), and LinkCache::singleton().

Title::isSemiProtected ( action = 'edit'  ) 

Is this page "semi-protected" - the *only* protection is autoconfirm?

Parameters:
@action  String : : Action to check (default: edit)
Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 957 of file Title.php.

References $action, exists(), and getRestrictions().

Title::isSingleRevRedirect (  ) 

Checks if this page is just a one-rev redirect.

Adds lock, so don't use just for light purposes.

Returns:
Boolean : : TRUE or FALSE

Definition at line 3063 of file Title.php.

References $dbw, $row, getDBkey(), getNamespace(), pageCond(), and wfGetDB().

Title::isSpecial ( name  ) 

Returns true if this title resolves to the named special page.

Parameters:
$name  String : : The special page name

Definition at line 3577 of file Title.php.

References $name, getDBkey(), getNamespace(), and SpecialPage::resolveAliasWithSubpage().

Referenced by isValidRedirectTarget(), and userCanRead().

Title::isSubpage (  ) 

Is this a subpage?

Returns:
Boolean : : TRUE or FALSE

Definition at line 1594 of file Title.php.

References getText(), and hasSubpages().

Referenced by getUserPermissionsErrorsInternal().

Title::isTalkPage (  ) 

Is this a talk page of some sort?

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1586 of file Title.php.

References getNamespace(), and MWNamespace::isTalk().

Referenced by getUserPermissionsErrorsInternal().

Title::isTrans (  ) 

Determine whether the object refers to a page within this project and is transcludable.

Returns:
Boolean : : TRUE if this is transcludable

Reimplemented in FakeTitle.

Definition at line 508 of file Title.php.

References Interwiki::fetch().

Title::isValidCssJsSubpage (  ) 

Is this a *valid* .css or .js subpage of a user page? Check that the corresponding skin exists.

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1674 of file Title.php.

References getSkinFromCssJsSubpage(), Skin::getSkinNames(), and isCssJsSubpage().

Title::isValidMoveOperation ( &$  nt,
auth = true,
reason = '' 
)

Check whether a given move operation would be valid.

Returns true if ok, or a getUserPermissionsErrors()-like array otherwise

Parameters:
&$nt  Title : the new title
$auth  Boolean : : indicates whether $wgUser's permissions should be checked
$reason  String : : is the log summary of the move, used for spam checking
Returns:
Mixed : : True on success, getUserPermissionsErrors()-like array on failure

Definition at line 2560 of file Title.php.

References $file, $reason, $wgUser, File::checkExtensionCompatibility(), equals(), exists(), getArticleID(), getDBkey(), getNamespace(), getNsText(), getUserPermissionsErrors(), isMovable(), isValidMoveTarget(), EditPage::matchSummarySpamRegex(), wfLocalFile(), wfMergeErrorArrays(), wfRunHooks(), and wfStripIllegalFilenameChars().

Referenced by moveTo().

Title::isValidMoveTarget ( nt  ) 

Checks if $this can be moved to a given Title

  • Selects for update, so don't call it unless you mean business.

Parameters:
&$nt  Title : the new title to check
Returns:
Boolean : : TRUE or FALSE

Definition at line 3101 of file Title.php.

References $dbw, $file, $text, getPrefixedDBkey(), newFromText(), Revision::newFromTitle(), wfDebug(), wfGetDB(), and wfLocalFile().

Referenced by isValidMoveOperation().

Title::isValidRedirectTarget (  ) 

Check if this Title is a valid redirect target.

Returns:
Boolean : : TRUE or FALSE

Definition at line 3652 of file Title.php.

References $wgInvalidRedirectTargets, and isSpecial().

Title::isWatchable (  ) 

Can this title be added to a user's watchlist?

Returns:
Boolean : : TRUE or FALSE

Definition at line 3143 of file Title.php.

References getNamespace(), and isExternal().

static Title::legalChars (  )  [static]

Get a regex character class describing the legal characters in a link.

Returns:
String : : the list of characters, not delimited

Definition at line 423 of file Title.php.

References $wgLegalTitleChars.

Referenced by languages::getMessagesWithDubiousLinks(), Parser_LinkHooks::replaceInternalLinks2(), Parser::replaceInternalLinks2(), secureAndSplit(), and wfStripIllegalFilenameChars().

Title::loadRestrictions ( oldFashionedRestrictions = NULL  ) 

Load restrictions from the page_restrictions table.

Reimplemented in FakeTitle.

Definition at line 1903 of file Title.php.

References $dbr, $res, Block::decodeExpiry(), exists(), getTitleProtection(), loadRestrictionsFromRow(), purgeExpiredRestrictions(), wfGetDB(), and wfTimestampNow().

Referenced by areRestrictionsCascading(), getRestrictionExpiry(), and getRestrictions().

Title::loadRestrictionsFromRow ( res,
oldFashionedRestrictions = NULL 
) [private]

Loads a string into mRestrictions array.

Parameters:
$res  Resource : restrictions as an SQL result.

Definition at line 1829 of file Title.php.

References $dbr, $res, $row, $type, $wgRestrictionTypes, Block::decodeExpiry(), purgeExpiredRestrictions(), wfGetDB(), and wfTimestampNow().

Referenced by loadRestrictions().

static Title::makeName ( ns,
title,
fragment = '' 
) [static]

Definition at line 464 of file Title.php.

References $name, $ns, $title, and $wgContLang.

Referenced by MovePageForm::doSubmit(), LinkHolderArray::doVariants(), makeTitleSafe(), and nameOf().

static& Title::makeTitle ( ns,
title,
fragment = '' 
) [static]

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.

Parameters:
$ns  Integer : : the namespace of the article
$title  String : : the unprefixed database key form
$fragment  String : : The link fragment (after the "#")
Returns:
Title : the new object

Definition at line 250 of file Title.php.

References $ns, $t, $title, and wfUrlencode().

Referenced by SearchResult::__construct(), LinkBatch::addResultToCache(), UploadForm::ajaxGetLicensePreview(), MediaWiki::articleFromTitle(), LocalRepo::checkRedirect(), checkSeparation(), compressWithConcat(), deleteDefaultMessages(), CategoryViewer::doCategoryQuery(), RestrictUserForm::doNamespaceRestriction(), RestrictUserForm::doPageRestriction(), SpecialTags::doTagRow(), IPUnblockForm::doUnblock(), LinkHolderArray::doVariants(), ApiQueryDeletedrevs::execute(), ApiQueryBacklinks::extractRedirRowInfo(), ApiQueryWatchlist::extractRowInfo(), ApiQueryContributions::extractRowInfo(), ApiQueryRecentChanges::extractRowInfo(), ApiQueryRandom::extractRowInfo(), ApiQueryLogEvents::extractRowInfo(), ApiQueryBacklinks::extractRowInfo(), Article::fetchContent(), SpecialRecentChanges::filterByCategories(), ForeignAPIRepo::findBySha1(), DoubleRedirectJob::fixRedirects(), fixSpecialName(), ImagePage::followRedirect(), FeedUtils::formatDiff(), ApiParse::formatLinks(), WantedTemplatesPage::formatResult(), WantedFilesPage::formatResult(), WantedCategoriesPage::formatResult(), UnwatchedpagesPage::formatResult(), UnusedtemplatesPage::formatResult(), UnusedCategoriesPage::formatResult(), PopularPagesPage::formatResult(), MostrevisionsPage::formatResult(), MostlinkedCategoriesPage::formatResult(), MIMEsearchPage::formatResult(), ListredirectsPage::formatResult(), LinkSearchPage::formatResult(), FileDuplicateSearchPage::formatResult(), DoubleRedirectsPage::formatResult(), DisambiguationsPage::formatResult(), BrokenRedirectsPage::formatResult(), AncientPagesPage::formatResult(), UsersPager::formatRow(), DeletedContribsPager::formatRow(), CategoryPager::formatRow(), ImageListPager::formatValue(), ParserTest::fuzzTest(), ChangesFeed::generateFeed(), GenerateSitemap::generateLimit(), getBrokenLinksFrom(), User::getCanonicalName(), getCascadeProtectionSources(), UploadForm::getDupeWarning(), UploadForm::getExistsWarning(), DoubleRedirectJob::getFinalDestination(), Article::getHiddenCategories(), SpecialExport::getLinks(), getLinksTo(), RecentChange::getMovedToTitle(), MessageCache::getMsgFromNamespace(), SearchEngine::getNearMatch(), ApiQueryInfo::getProtectionInfo(), SpecialMytalk::getRedirect(), SpecialMypage::getRedirect(), File::getRedirectedTitle(), ImagePage::getRedirectTarget(), Article::getRedirectTarget(), ApiPageSet::getRedirectTargets(), DisambiguationsPage::getSQL(), getSubjectPage(), getTalkPage(), Parser::getTemplateDom(), EditPage::getTemplates(), Revision::getTitle(), RecentChange::getTitle(), TitleDependency::getTitle(), SpecialPage::getTitleFor(), LogPage::getTitleLink(), Article::getUsedTemplates(), UserRightsProxy::getUserPage(), User::getUserPage(), ImagePage::imageLinks(), ApiPageSet::initFromQueryResult(), SpecialRevisionDelete::logLine(), LogEventsList::logLine(), GenerateSitemap::main(), SkinMonoBookCBT::makeSpecialParamUrl(), newFromID(), newFromIDs(), SquidUpdate::newFromLinksTo(), newFromRow(), OldLocalFile::newFromRow(), ForeignDBFile::newFromRow(), ArchivedFile::newFromRow(), XmlDumpWriter::openPage(), WikiImporter::out_append(), ImageCleanup::pokeFile(), ApiPageSet::processDbRow(), WatchlistCleanup::processPage(), TitleCleanup::processPage(), CapsCleanup::processPage(), LinkHolderArray::replaceInternal(), Revision::Revision(), DoubleRedirectJob::run(), ApiQueryWatchlistRaw::run(), ApiQueryProtectedTitles::run(), ApiQueryLinks::run(), ApiQueryImages::run(), ApiQueryExtLinksUsage::run(), ApiQueryDuplicateFiles::run(), ApiQueryCategoryMembers::run(), ApiQueryCategories::run(), ApiQueryBacklinks::run(), ApiQueryAllpages::run(), ApiQueryAllLinks::run(), ApiQueryAllimages::run(), ApiQueryAllCategories::run(), ParserTest::runTest(), RecentChange::save(), SpecialAllpages::showChunk(), WhatLinksHerePage::showIndirectLinks(), SpecialPrefixindex::showPrefixChunk(), PrefixSearch::specialSearch(), updateSearchIndex(), CoreParserFunctions::urlFunction(), Linker::userLink(), Linker::userTalkLink(), ImagePage::view(), wfAllMessagesMakeHTMLText(), wfSpecialLinkSearch(), wfSpecialNewimages(), wfSpecialRemoveRestrictionsProcess(), and XmlDumpWriter::writeLogItem().

static Title::makeTitleSafe ( ns,
title,
fragment = '' 
) [static]

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.

Parameters:
$ns  Integer : : the namespace of the article
$title  String : : the database key form
$fragment  String : : The link fragment (after the "#")
Returns:
Title : the new object, or NULL on an error

Definition at line 272 of file Title.php.

References $ns, $t, $title, and makeName().

Referenced by UsersPager::__construct(), UnregisteredLocalFile::__construct(), OutputPage::addCategoryLinks(), ProtectionForm::buildForm(), WatchlistEditor::buildRemoveList(), ImageCleanup::buildSafeTitle(), Parser::doDoubleUnderscore(), MovePageForm::doSubmit(), SpecialExport::execute(), DeletedContributionsPage::execute(), SpecialContributions::execute(), ApiQueryInfo::execute(), SpecialContributions::feed(), FileRepo::findFile(), FileCache::findFile(), RepoGroup::findFiles(), FileCache::findFiles(), SpecialNewpages::form(), Linker::formatAutocommentsCallback(), WantedPagesPage::formatResult(), ShortPagesPage::formatResult(), SpecialMostlinkedtemplates::formatResult(), MostlinkedPage::formatResult(), MostcategoriesPage::formatResult(), FewestrevisionsPage::formatResult(), PageQueryPage::formatResult(), ProtectedTitlesForm::formatRow(), ProtectedPagesForm::formatRow(), SpecialNewpages::formatRow(), UsersPager::getBody(), CategoryPager::getBody(), LinksUpdate::getCategoryInsertions(), SpecialStatistics::getMostViewedPages(), SpecialAllpages::getNamespaceKeyAndText(), ApiBase::getParameterFromSettings(), NewPagesPager::getQueryInfo(), RandomPage::getRandomTitle(), SpecialPage::getSafeTitleFor(), DisambiguationsPage::getSQL(), MergeHistoryPager::getStartBody(), LogPager::getStartBody(), Category::getTitle(), WatchlistEditor::getWatchlist(), WatchlistEditor::getWatchlistInfo(), User::idFromName(), UploadForm::internalProcessUpload(), Parser::limitationWarn(), LogPager::limitUser(), PreferencesForm::mainPrefsForm(), UploadForm::mainUploadForm(), Linker::makeMediaLink(), makeNSUrl(), Linker::makeThumbLink2(), TitleCleanup::moveInconsistentPage(), moveSubpages(), FileRepo::newFile(), Image::newFromName(), Category::newFromName(), LanguageConverter::parseCachedTable(), ApiQueryBacklinks::parseContinueParam(), Job::pop(), Job::pop_type(), ImageQueryPage::prepareImage(), ImageCleanup::processPage(), PatrolLog::record(), NamespaceConflictChecker::reportConflict(), NamespaceConflictChecker::resolveConflict(), NamespaceConflictChecker::resolveConflictOn(), IPBlockForm::setUsernameBitfields(), UndeleteForm::showHistory(), UndeleteForm::showList(), SpecialBookSources::showList(), SpecialAllpages::showToplevel(), wfSpecialFilepath(), and wfThumbMain().

Title::moveNoAuth ( &$  nt  ) 

Move this page without authentication.

Parameters:
&$nt  Title : the new page Title

Definition at line 2547 of file Title.php.

References moveTo().

Title::moveOverExistingRedirect ( &$  nt,
reason = '',
createRedirect = true 
) [private]

Move page to a title which is at present a redirect to the source page.

Parameters:
&$nt  Title : the page to move to, which should currently be a redirect
$reason  String : : The reason for the move
$createRedirect  Boolean : : Whether to leave a redirect at the old title. Ignored if the user doesn't have the suppressredirect right

Definition at line 2789 of file Title.php.

References $dbw, $file, $fname, $reason, $status, $u, $urls, $wgUser, $wgUseSquid, $wgUseTrackbacks, MagicWord::get(), getArticleID(), getLatestRevID(), getNamespace(), getPrefixedText(), getSquidURLs(), Revision::newNullRevision(), resetArticleID(), wfGetDB(), wfLocalFile(), wfMsgForContent(), wfRunHooks(), and wfTimestampNow().

Referenced by moveTo().

Title::moveSubpages ( nt,
auth = true,
reason = '',
createRedirect = true 
)

Move this page's subpages to be subpages of $nt.

Parameters:
$nt Title Move target
$auth bool Whether $wgUser's permissions should be checked
$reason string The reason for the move
$createRedirect bool Whether to create redirects from the old subpages to the new ones Ignored if the user doesn't have the 'suppressredirect' right
Returns:
mixed array with old page titles as keys, and strings (new page titles) or arrays (errors) as values, or an error array with numeric indices if no pages were moved

Definition at line 3006 of file Title.php.

References $count, $reason, $success, $wgMaximumMovedPages, $wgUser, MWNamespace::getCanonicalName(), getNamespace(), getSubpages(), MWNamespace::hasSubpages(), makeTitleSafe(), and userCan().

Title::moveTo ( &$  nt,
auth = true,
reason = '',
createRedirect = true 
)

Move a title to a new location.

Parameters:
&$nt  Title : the new title
$auth  Boolean : : indicates whether $wgUser's permissions should be checked
$reason  String : : The reason for the move
$createRedirect  Boolean : : Whether to create a redirect from the old title to the new title. Ignored if the user doesn't have the suppressredirect right.
Returns:
Mixed : : true on success, getUserPermissionsErrors()-like array on failure

Definition at line 2659 of file Title.php.

References $dbw, $reason, $u, $wgMessageCache, $wgUser, WatchedItem::duplicateEntries(), getArticleID(), getDBkey(), getNamespace(), getPrefixedDBkey(), getPrefixedText(), isContentPage(), isProtected(), isValidMoveOperation(), moveOverExistingRedirect(), wfGetDB(), wfMsgForContent(), and wfRunHooks().

Referenced by moveNoAuth().

Title::moveToNewTitle ( &$  nt,
reason = '',
createRedirect = true 
) [private]

Move page to non-existing title.

Parameters:
&$nt {Title} the new Title
$reason {} The reason for the move
$createRedirect {} Whether to create a redirect from the old title to the new title Ignored if the user doesn't have the suppressredirect right

Definition at line 2906 of file Title.php.

References $dbw, $file, $fname, $reason, $status, $wgUser, $wgUseSquid, MagicWord::get(), getArticleID(), getNamespace(), getPrefixedText(), Revision::newNullRevision(), Article::onArticleCreate(), purgeSquid(), resetArticleID(), wfGetDB(), wfLocalFile(), wfMsgExt(), wfMsgForContent(), and wfRunHooks().

static Title::nameOf ( id  )  [static]

Get the prefixed DB key associated with an ID.

Parameters:
$id  Integer : : the page_id of the article
Returns:
Title : an object representing the article, or NULL if no such article was found

Definition at line 406 of file Title.php.

References $dbr, $n, $s, makeName(), and wfGetDB().

static Title::newFromDBkey ( key  )  [static]

Create a new Title from a prefixed DB key.

Parameters:
$key {} The database key, which has underscores instead of spaces, possibly including namespace and interwiki prefixes
Returns:
{Title} the new object, or NULL on an error

Definition at line 89 of file Title.php.

References $key, and $t.

Referenced by LinkCache::addLink(), LinkHolderArray::doVariants(), and wfAjaxWatch().

static Title::newFromID ( id,
flags = 0 
) [static]

Create a new Title from an article ID.

Todo:
This is inefficiently implemented, the page row is requested but not used for anything else
Parameters:
$id  Integer : : the page_id corresponding to the Title to create
$flags  Integer : : use GAID_FOR_UPDATE to use master
Returns:
Title : the new object, or NULL on an error

Definition at line 189 of file Title.php.

References $db, $flags, $fname, $row, $title, makeTitle(), and wfGetDB().

Referenced by MediaWiki::checkInitialQueries(), cleanupArticle(), ApiMove::execute(), ApiDelete::execute(), fixLinksFromArticle(), fixRedirect(), DisambiguationsPage::formatResult(), and MergehistoryForm::merge().

static Title::newFromIDs ( ids  )  [static]

Make an array of titles from an array of IDs.

Parameters:
$ids  { Integer :} : Array of IDs
Returns:
{Title} : Array of Titles

Definition at line 207 of file Title.php.

References $dbr, $res, $row, makeTitle(), and wfGetDB().

static Title::newFromRedirect ( text  )  [static]

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.

Parameters:
$text  String : : Text with possible redirect
Returns:
Title : The corresponding Title

Definition at line 304 of file Title.php.

References $text, and newFromRedirectInternal().

Referenced by ListredirectsPage::formatResult(), Article::getAutosummary(), Article::insertRedirect(), EditPage::internalAttemptSave(), Article::isRedirect(), DoubleRedirectJob::run(), Parser::statelessFetchTemplate(), and Article::updateRevisionOn().

static Title::newFromRedirectArray ( text  )  [static]

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

Parameters:
$text  String : : Text with possible redirect
Returns:
: Array of Titles, with the destination last

Definition at line 331 of file Title.php.

References $text, $title, $wgMaxRedirects, and newFromRedirectInternal().

Referenced by EditPage::getPreviewText(), newFromRedirectRecurse(), and Article::view().

static Title::newFromRedirectInternal ( text  )  [static, protected]

Really extract the redirect destination Do not call this function directly, use one of the newFromRedirect* functions above.

Parameters:
$text  String : : Text with possible redirect
Returns:
Title : The corresponding Title

Definition at line 368 of file Title.php.

References $text, $title, MagicWord::get(), and newFromText().

Referenced by newFromRedirect(), and newFromRedirectArray().

static Title::newFromRedirectRecurse ( text  )  [static]

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.

Parameters:
$text  String : : Text with possible redirect
Returns:
Title : The corresponding Title

Definition at line 317 of file Title.php.

References $text, and newFromRedirectArray().

Referenced by Article::followRedirectText(), and Article::isRedirect().

static Title::newFromRow ( row  )  [static]

Make a Title object from a DB row.

Parameters:
$row  Row : (needs at least page_title,page_namespace)
Returns:
Title : corresponding Title

Definition at line 227 of file Title.php.

References $row, $t, and makeTitle().

Referenced by ContribsPager::formatRow(), File::getLinksTo(), getRedirectsHere(), and TitleArrayFromResult::setCurrent().

static Title::newFromText ( text,
defaultNamespace = NS_MAIN 
) [static]

Create a new Title from text, such as what one would find in a link.

De- codes any HTML entities in the text.

Parameters:
$text string The link text; spaces, prefixes, and an initial ':' indicating the main namespace are accepted.
$defaultNamespace int The namespace to use if none is speci- fied by a prefix. If you want to force a specific namespace even if $text might begin with a namespace prefix, use makeTitle() or makeTitleSafe().
Returns:
Title The new object, or null on an error.

Definition at line 110 of file Title.php.

References $t, $text, $titleCache, and Sanitizer::decodeCharReferences().

Referenced by DoubleRedirectJob::__construct(), ParserTest::addArticle(), ApiQueryLogEvents::addLogParams(), Skin::addMetadataLinks(), addWiki(), ApiQuerySiteinfo::appendGeneralInfo(), ApiQuerySiteinfo::appendRightsInfo(), CoreParserFunctions::basepagename(), CoreParserFunctions::basepagenamee(), Parser::braceSubstitution(), SkinTemplate::buildPersonalUrls(), buildSidebar(), checkTitle(), ApiFeedWatchlist::createFeedItem(), CoreParserFunctions::displaytitle(), SpecialExport::doExport(), RestrictUserForm::doPageRestriction(), drawCategoryBrowser(), Linker::editSectionLinkForOther(), SpecialResetpass::execute(), ApiWatch::execute(), ApiUndelete::execute(), ApiRollback::execute(), ApiQueryLogEvents::execute(), ApiPurge::execute(), ApiProtect::execute(), ApiParse::execute(), ApiMove::execute(), ApiExpandTemplates::execute(), ApiEditPage::execute(), ApiDelete::execute(), EditPage::extractMetaDataFromArticle(), WatchlistEditor::extractTitles(), DBConnectionError::fileCachedPage(), LanguageConverter::findVariantLink(), Linker::formatAutocommentsCallback(), Parser::formatHeadings(), CoreParserFunctions::fullpagename(), CoreParserFunctions::fullpagenamee(), CoreParserFunctions::gender(), User::getCanonicalName(), getCategoryLinks(), SpecialListUserRestrictionsForm::getConds(), UploadForm::getExistsWarning(), User::getGroupPage(), RecentChange::getIRCLine(), SpecialExport::getLinks(), SearchEngine::getNearMatch(), getParentCategoryTree(), EditPage::getPreloadedText(), DisambiguationsPage::getSQL(), LogPage::getTitleLink(), SpecialSearchOld::goResult(), SpecialSearch::goResult(), LogImporter::importLine(), isValidMoveTarget(), User::isValidUserName(), SkinMonoBookCBT::language_urls(), LogPager::limitTitle(), PageArchive::listPagesByPrefix(), LogEventsList::logLine(), SkinTemplate::makeArticleUrlDetails(), Linker::makeBrokenLink(), makeI18nUrl(), Parser::makeImage(), Linker::makeKnownLink(), makeKnownUrlDetails(), Linker::makeLink(), Linker::makeStubLink(), SkinTemplate::makeTalkUrlDetails(), PPFuzzTester::makeTitle(), makeUrl(), makeUrlDetails(), TitleCleanup::moveIllegalPage(), CoreParserFunctions::mwnamespace(), nameAndLogin(), CoreParserFunctions::namespacee(), ImportStreamSource::newFromInterwiki(), newFromRedirectInternal(), newMainPage(), NukeNS(), NukePage(), otherLanguages(), WikiImporter::out_append(), SkinTemplate::outputPage(), WikiExporter::pageByName(), CoreParserFunctions::pagename(), CoreParserFunctions::pagenamee(), RdfMetaData::pageOrString(), RestrictUserForm::pageRestrictionForm(), CoreParserFunctions::pagesize(), SpecialSearch::powerSearchBox(), ApiQueryBacklinks::processContinue(), WatchlistCleanup::processPage(), TitleCleanup::processPage(), ApiPageSet::processTitlesArray(), EnhancedChangesList::recentChangesBlockLine(), OldChangesList::recentChangesLine(), Parser::renderImageGallery(), Parser::replaceInternalLinks2(), Parser_LinkHooks::replaceInternalLinksCallback(), OutputPage::returnToMain(), RdfMetaData::rights(), ApiQueryCategoryMembers::run(), ApiQueryCategories::run(), MWGearmanJob::runNoSwitch(), SearchUpdate::SearchUpdate(), Parser::setTitle(), SpecialSearchOld::setupPage(), SpecialSearch::shortDialog(), EditPage::showCustomIntro(), SpecialSearchOld::showInterwikiHit(), SpecialSearch::showInterwikiHit(), SpecialSearch::showResults(), WatchlistEditor::showTitles(), CoreParserFunctions::subjectpagename(), CoreParserFunctions::subjectpagenamee(), CoreParserFunctions::subjectspace(), CoreParserFunctions::subjectspacee(), CoreParserFunctions::subpagename(), CoreParserFunctions::subpagenamee(), subPageSubtitle(), LoginForm::successfulLogin(), CoreParserFunctions::talkpagename(), CoreParserFunctions::talkpagenamee(), CoreParserFunctions::talkspace(), CoreParserFunctions::talkspacee(), Parser::testPreprocess(), Parser::testPst(), Parser::testSrvus(), PrefixSearch::titleSearch(), ApiQueryBase::titleToKey(), WatchlistEditor::unwatchTitles(), CoreParserFunctions::urlFunction(), WatchlistEditor::watchTitles(), wfIsBadImage(), wfSpecialFileDuplicateSearch(), wfSpecialMovepage(), wfSpecialNewimages(), and wfViewPrevNext().

static Title::newFromURL ( url  )  [static]

Create a new Title from URL-encoded text.

Ensures that the given title's length does not exceed the maximum.

Parameters:
$url  String : : the title, as might be taken from a URL
Returns:
Title : the new object, or NULL on an error

Definition at line 160 of file Title.php.

References $t, $url, and $wgLegalTitleChars.

Referenced by MediaWiki::checkInitialQueries(), SpecialRecentchangeslinked::doMainQuery(), WhatLinksHerePage::execute(), DBConnectionError::fileCachedPage(), MergehistoryForm::MergehistoryForm(), and UndeleteForm::UndeleteForm().

static Title::newMainPage (  )  [static]

Title::pageCond (  ) 

Get an associative array for selecting this title from the "page" table.

Returns:
: Selection array

Reimplemented in FakeTitle.

Definition at line 3214 of file Title.php.

Referenced by getLatestRevID(), getTouched(), invalidateCache(), isNewPage(), and isSingleRevRedirect().

Title::prefix ( name  ) 

Prefix some arbitrary text with the namespace or interwiki prefix of this object.

Parameters:
$name  String : : the text
Returns:
String : : the prefixed text
Access:
private

Definition at line 2145 of file Title.php.

References $name, and getNsText().

Referenced by getPrefixedDBkey(), getPrefixedText(), and getPrefixedURL().

static Title::purgeExpiredRestrictions (  )  [static]

Purge expired restrictions from the page_restrictions table.

Definition at line 1939 of file Title.php.

References $dbw, and wfGetDB().

Referenced by getCascadeProtectionSources(), loadRestrictions(), loadRestrictionsFromRow(), ProtectedTitlesForm::showList(), ProtectedPagesForm::showList(), and Article::updateRestrictions().

Title::purgeSquid (  ) 

Purge all applicable Squid URLs.

Definition at line 2534 of file Title.php.

References $u, $urls, $wgUseSquid, and getSquidURLs().

Referenced by moveToNewTitle().

Title::quickUserCan ( action  ) 

Can $wgUser perform $action on this page? This skips potentially expensive cascading permission checks.

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.

Parameters:
$action  String : : action that permission needs to be checked for
Returns:
Boolean : :

Definition at line 1033 of file Title.php.

References $action, and userCan().

Title::resetArticleID ( newid  ) 

This clears some fields in this object, and clears any associated keys in the "bad links" section of the link cache.

Parameters:
$newid  Integer : : the new Article ID

Reimplemented in FakeTitle.

Definition at line 2109 of file Title.php.

References getPrefixedDBkey(), and LinkCache::singleton().

Referenced by moveOverExistingRedirect(), and moveToNewTitle().

Title::secureAndSplit (  )  [private]

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.

Returns:
Boolean : : true on success

Definition at line 2166 of file Title.php.

References $ns, $wgCapitalLinks, $wgContLang, $wgLocalInterwiki, is(), Interwiki::isValidInterwiki(), legalChars(), IP::sanitizeIP(), setFragment(), and wfUrlencode().

Title::setFragment ( fragment  ) 

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.

Parameters:
$fragment  String : : text

Definition at line 2386 of file Title.php.

Referenced by secureAndSplit().

Title::touchLinks (  ) 

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.

Reimplemented in FakeTitle.

Definition at line 3441 of file Title.php.

References $u, and getNamespace().

Title::trackbackRDF (  ) 

Get the trackback RDF for this page.

Returns:
String : : Trackback RDF

Reimplemented in FakeTitle.

Definition at line 3510 of file Title.php.

References $tburl, $title, $url, getFullURL(), getText(), and trackbackURL().

Title::trackbackURL (  ) 

Get the trackback URL for this page.

Returns:
String : : Trackback URL

Reimplemented in FakeTitle.

Definition at line 3499 of file Title.php.

References $wgScriptExtension, $wgScriptPath, $wgServer, and getPrefixedDBkey().

Referenced by trackbackRDF().

Title::updateTitleProtection ( create_perm,
reason,
expiry 
)

Update the title protection status.

Parameters:
$create_perm  String : : Permission required for creation
$reason  String : : Reason for protection
$expiry  String : : Expiry timestamp

Definition at line 1409 of file Title.php.

References $dbw, $reason, $title, $wgContLang, $wgUser, Block::encodeExpiry(), getDBkey(), getNamespace(), getRestrictions(), wfGetDB(), wfMsgForContent(), and wfTimestampNow().

Title::userCan ( action,
doExpensiveQueries = true 
)

Can $wgUser perform $action on this page?

Parameters:
$action  String : : action that permission needs to be checked for
$doExpensiveQueries  Boolean : : Set this to false to avoid doing unnecessary queries.
Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 1060 of file Title.php.

References $action, $wgUser, and getUserPermissionsErrorsInternal().

Referenced by moveSubpages(), quickUserCan(), userCanCreate(), userCanEdit(), and userCanMove().

Title::userCanCreate ( doExpensiveQueries = true  ) 

Can $wgUser create this page?

Returns:
Boolean : : TRUE or FALSE
Deprecated:
use userCan('create')

Definition at line 1482 of file Title.php.

References userCan().

Title::userCanEdit ( doExpensiveQueries = true  ) 

Can $wgUser edit this page?

Returns:
Boolean : : TRUE or FALSE
Deprecated:
use userCan('edit')

Reimplemented in FakeTitle.

Definition at line 1473 of file Title.php.

References userCan().

Title::userCanEditCssJsSubpage (  ) 

Protect css/js subpages of user pages: can $wgUser edit this page?

Returns:
Boolean : : TRUE or FALSE
Todo:
XXX: this might be better using restrictions

Reimplemented in FakeTitle.

Definition at line 1711 of file Title.php.

References $wgUser.

Title::userCanMove ( doExpensiveQueries = true  ) 

Can $wgUser move this page?

Returns:
Boolean : : TRUE or FALSE
Deprecated:
use userCan('move')

Definition at line 1491 of file Title.php.

References userCan().

Title::userCanRead (  ) 

Can $wgUser read this page?

Returns:
Boolean : : TRUE or FALSE
Todo:
fold these checks into userCan()

Reimplemented in FakeTitle.

Definition at line 1510 of file Title.php.

References $name, $result, $wgGroupPermissions, $wgUser, $wgWhitelistRead, getDBkey(), getNamespace(), getPrefixedText(), SpecialPage::getTitleFor(), isSpecial(), SpecialPage::resolveAliasWithSubpage(), and wfRunHooks().

Title::userIsWatching (  ) 

Is $wgUser watching this page?

Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 1008 of file Title.php.

References $wgUser.


Member Data Documentation

Title::$interwikiCache = array() [static, private]

Definition at line 29 of file Title.php.

Title::$mArticleID = -1

Article ID, fetched from the link cache on demand.

Definition at line 54 of file Title.php.

Title::$mBacklinkCache = null

Cache of links to this title.

Definition at line 72 of file Title.php.

Title::$mCascadeRestriction

Cascade restrictions on this page to included templates and images?

Definition at line 58 of file Title.php.

Title::$mCascadeSources

Where are the cascading restrictions coming from on this page?

Definition at line 61 of file Title.php.

Title::$mDbkeyform = ''

Main part with underscores.

Definition at line 49 of file Title.php.

Title::$mDefaultNamespace = NS_MAIN

Namespace index when there is no namespace.

Definition at line 66 of file Title.php.

Title::$mFragment

Title fragment (i.e. the bit after the #).

Definition at line 53 of file Title.php.

Title::$mHasCascadingRestrictions

Are cascading restrictions in effect on this page?

Definition at line 60 of file Title.php.

Title::$mInterwiki = ''

Interwiki prefix (or null string).

Definition at line 52 of file Title.php.

Title::$mLatestID = false

ID of most recent revision.

Definition at line 55 of file Title.php.

Title::$mLength = -1

The page length, 0 for special pages.

Definition at line 69 of file Title.php.

Title::$mNamespace = NS_MAIN

Namespace index, i.e. one of the NS_xxxx constants.

Definition at line 51 of file Title.php.

Title::$mNotificationTimestamp = array()

Associative array of user ID -> timestamp/false.

Definition at line 71 of file Title.php.

Title::$mOldRestrictions = false

Text form (spaces not underscores) of the main part.

Definition at line 57 of file Title.php.

Title::$mPrefixedText

Text form including namespace/interwiki, initialised on demand.

Definition at line 63 of file Title.php.

Title::$mRedirect = null

Is the article at this title a redirect?

Definition at line 70 of file Title.php.

Title::$mRestrictions = array()

Array of groups allowed to edit this article.

Definition at line 56 of file Title.php.

Title::$mRestrictionsExpiry = array()

When do the restrictions on this page expire?

Definition at line 59 of file Title.php.

Title::$mRestrictionsLoaded = false

Boolean for initialisation on demand.

Definition at line 62 of file Title.php.

Title::$mTextform = ''

Text form (spaces not underscores) of the main part.

Definition at line 47 of file Title.php.

Title::$mUrlform = ''

URL-encoded form of the main part.

Definition at line 48 of file Title.php.

Title::$mUserCaseDBKey

DB key with the initial letter in the case specified by the user.

Definition at line 50 of file Title.php.

Title::$mWatched = null

Is $wgUser watching this page? null if unfilled, accessed through userIsWatching().

Definition at line 68 of file Title.php.

Title::$titleCache = array() [static, private]

Definition at line 28 of file Title.php.

Referenced by newFromText().

const Title::CACHE_MAX = 1000

Title::newFromText maintains a cache to avoid expensive re-normalization of commonly used titles.

On a batch operation this can become a memory leak if not bounded. After hitting this many titles reset the cache.

Definition at line 37 of file Title.php.


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

Generated on Sat Sep 5 02:08:48 2009 for MediaWiki by  doxygen 1.5.9