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?
 isConversionTable ()
 Is this a conversion table for the LanguageConverter?
 userIsWatching ()
 Is $wgUser watching this page?
 quickUserCan ($action)
 Can $wgUser perform $action on this page? This skips potentially expensive cascading permission checks as well as avoids expensive error formatting.
 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.
 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?
 userCanEditCssSubpage ()
 Protect css subpages of user pages: can $wgUser edit this page?
 userCanEditJsSubpage ()
 Protect 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 ()
 loadRestrictionsFromRows ($rows, $oldFashionedRestrictions=null)
 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 ($prepend= 'nstab-')
 Generate strings used for xml 'id' names in monobook tabs.
 isSpecialPage ()
 Returns true if this is a special page.
 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.
 canUseNoindex ()
 Whether the magic words __INDEX__ and __NOINDEX__ function for this page.
 getRestrictionTypes ()

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)
 THIS IS NOT THE FUNCTION YOU WANT.
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= '')
 Make a prefixed DB key from a DB key and a namespace index.
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 getTitleInvalidRegex ()
static capitalize ($text, $ns=NS_MAIN)
 Capitalize a text if it belongs to a namespace that capitalizes.
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?
 loadRestrictionsFromResultWrapper ($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 19 of file Title.php.


Constructor & Destructor Documentation

Title::__construct (  )  [private]

Constructor.

Definition at line 74 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 3456 of file Title.php.

References getPrefixedText().

Title::areRestrictionsCascading (  ) 

Reimplemented in FakeTitle.

Definition at line 1867 of file Title.php.

References loadRestrictions().

Title::canExist (  ) 

Is this in a namespace that allows actual pages?

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 3531 of file Title.php.

Title::canTalk (  ) 

Could this title have a corresponding talk page?

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 583 of file Title.php.

References MWNamespace::canTalk().

Title::canUseNoindex (  ) 

Whether the magic words __INDEX__ and __NOINDEX__ function for this page.

Returns:
Bool

Reimplemented in FakeTitle.

Definition at line 3779 of file Title.php.

References $wgArticleRobotPolicies, $wgContentNamespaces, and $wgExemptFromUserRobotsControl.

static Title::capitalize ( text,
ns = NS_MAIN 
) [static]

Capitalize a text if it belongs to a namespace that capitalizes.

Definition at line 2245 of file Title.php.

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

Referenced by CategoryPager::__construct(), UploadBase::checkWarnings(), secureAndSplit(), and wfSpecialWithoutinterwiki().

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

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

Definition at line 3443 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.

Reimplemented in FakeTitle.

Definition at line 3417 of file Title.php.

References $dbr, and wfGetDB().

Title::deleteTitleProtection (  ) 

Remove any title protection due to page existing.

Reimplemented in FakeTitle.

Definition at line 1498 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

Reimplemented in FakeTitle.

Definition at line 3433 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 503 of file Title.php.

References 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 885 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 874 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 3469 of file Title.php.

Referenced by getEarliestRevTime(), getRestrictionTypes(), getTitleProtection(), 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.

Reimplemented in FakeTitle.

Definition at line 3686 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 2092 of file Title.php.

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

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

Title::getBacklinkCache (  ) 

Get a backlink cache object.

Reimplemented in FakeTitle.

Definition at line 3767 of file Title.php.

Title::getBaseText (  ) 

Get the base name, i.e.

the leftmost parts before the /

Returns:
String : : Base name

Reimplemented in FakeTitle.

Definition at line 665 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 2561 of file Title.php.

References $dbr, $res, 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.

Reimplemented in FakeTitle.

Definition at line 1783 of file Title.php.

References $dbr, $res, 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 611 of file Title.php.

Title::getEarliestRevTime (  ) 

Get the oldest revision timestamp of this page.

Returns:
string, MW timestamp

Reimplemented in FakeTitle.

Definition at line 3397 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 910 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 922 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)

Reimplemented in FakeTitle.

Definition at line 3366 of file Title.php.

References 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 595 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

Reimplemented in FakeTitle.

Definition at line 600 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 653 of file Title.php.

References 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 719 of file Title.php.

References $url, $wgContLang, $wgRequest, $wgServer, Interwiki::fetch(), getFragmentForURL(), getLocalURL(), 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 618 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 898 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 590 of file Title.php.

Referenced by equals(), and isMovable().

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 : : or false if the page doesn't exist

Reimplemented in FakeTitle.

Definition at line 2153 of file Title.php.

References 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 : :

Reimplemented in FakeTitle.

Definition at line 2135 of file Title.php.

References 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

Reimplemented in FakeTitle.

Definition at line 2510 of file Title.php.

References $options, $res, 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.

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

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

Reimplemented in FakeTitle.

Definition at line 855 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 765 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(), EditPage::getActionURL(), getEditURL(), getFullURL(), getInternalURL(), getLinkUrl(), and Linker::makeThumbLink2().

Title::getNamespace (  ) 

Title::getNamespaceKey ( prepend = 'nstab-'  ) 

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

Returns:
String : : XML 'id' name

Reimplemented in FakeTitle.

Definition at line 3636 of file Title.php.

References $wgContLang, MWNamespace::exists(), MWNamespace::getCanonicalName(), getNamespace(), MWNamespace::getSubject(), 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

Reimplemented in FakeTitle.

Definition at line 3348 of file Title.php.

References 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

Reimplemented in FakeTitle.

Definition at line 3566 of file Title.php.

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

Title::getNsText (  ) 

Get the namespace text.

Returns:
{} Namespace text

Reimplemented in FakeTitle.

Definition at line 540 of file Title.php.

References $wgContLang, MWNamespace::exists(), and MWNamespace::getCanonicalName().

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 3253 of file Title.php.

References $dbr, $res, $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

Reimplemented in FakeTitle.

Definition at line 3284 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 525 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 627 of file Title.php.

References $s, and prefix().

Referenced by getLocalURL(), Parser::getTemplateDom(), isValidMoveTarget(), Linker::makeImageLink2(), Parser::mergeSectionTrees(), 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 638 of file Title.php.

References $s, and prefix().

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

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 703 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

Reimplemented in FakeTitle.

Definition at line 3329 of file Title.php.

References 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

Reimplemented in FakeTitle.

Definition at line 3717 of file Title.php.

References $dbr, $res, 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.

Reimplemented in FakeTitle.

Definition at line 2033 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 2019 of file Title.php.

References $action, and loadRestrictions().

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

Title::getRestrictionTypes (  ) 

Reimplemented in FakeTitle.

Definition at line 3791 of file Title.php.

References $wgRestrictionTypes, exists(), getNamespace(), and wfRunHooks().

Referenced by isProtected(), and loadRestrictionsFromRows().

Title::getSkinFromCssJsSubpage (  ) 

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

Reimplemented in FakeTitle.

Definition at line 1721 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 2598 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 567 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 2491 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

Reimplemented in FakeTitle.

Definition at line 1667 of file Title.php.

References $dbr, $options, getDBkey(), 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

Reimplemented in FakeTitle.

Definition at line 681 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

Reimplemented in FakeTitle.

Definition at line 693 of file Title.php.

References getSubpageText(), and wfUrlencode().

Title::getTalkNsText (  ) 

Get the namespace text of the talk page.

Returns:
String : : Namespace text

Reimplemented in FakeTitle.

Definition at line 575 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 2481 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

Reimplemented in FakeTitle.

Definition at line 2551 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 520 of file Title.php.

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

static Title::getTitleInvalidRegex (  )  [static]

Definition at line 2222 of file Title.php.

References legalChars(), and csslex::URL.

Referenced by secureAndSplit().

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 1410 of file Title.php.

References $dbr, $res, exists(), 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

Reimplemented in FakeTitle.

Definition at line 3555 of file Title.php.

References pageCond(), and wfGetDB().

Title::getUserCaseDBKey (  ) 

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

Returns:
String : : DB key

Reimplemented in FakeTitle.

Definition at line 560 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.

Reimplemented in FakeTitle.

Definition at line 1073 of file Title.php.

References $action, $name, $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 1164 of file Title.php.

References $action, $page, $result, $wgGroupPermissions, getCascadeProtectionSources(), User::getGroupsWithPermission(), getNamespace(), getNsText(), getRestrictions(), getTitleProtection(), getUserPermissionsErrors(), isCssJsSubpage(), isCssSubpage(), isJsSubpage(), 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

Reimplemented in FakeTitle.

Definition at line 1641 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 434 of file Title.php.

References $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 2186 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 3489 of file Title.php.

References exists(), getDBkey(), 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.

Reimplemented in FakeTitle.

Definition at line 1770 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

Reimplemented in FakeTitle.

Definition at line 3706 of file Title.php.

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

Referenced by moveTo().

Title::isConversionTable (  ) 

Is this a conversion table for the LanguageConverter?

Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 991 of file Title.php.

References getNamespace(), and getText().

Title::isCssJsSubpage (  ) 

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

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1702 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

Reimplemented in FakeTitle.

Definition at line 1693 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 1730 of file Title.php.

Referenced by getUserPermissionsErrorsInternal().

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 2044 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

Reimplemented in FakeTitle.

Definition at line 2067 of file Title.php.

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

Title::isExternal (  ) 

Is this Title interwiki?

Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 930 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 1737 of file Title.php.

Referenced by getUserPermissionsErrorsInternal().

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 3522 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 479 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 1512 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 : :

Reimplemented in FakeTitle.

Definition at line 1040 of file Title.php.

References $wgNamespaceProtection, and $wgUser.

Referenced by getUserPermissionsErrorsInternal().

Title::isNewPage (  ) 

Check if this is a new page.

Returns:
bool

Reimplemented in FakeTitle.

Definition at line 3387 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 all actions.
Returns:
Boolean : :

Reimplemented in FakeTitle.

Definition at line 963 of file Title.php.

References $action, $wgRestrictionLevels, getNamespace(), getRestrictions(), and getRestrictionTypes().

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 : :

Reimplemented in FakeTitle.

Definition at line 2116 of file Title.php.

References 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 938 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

Reimplemented in FakeTitle.

Definition at line 3162 of file Title.php.

References $dbw, 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

Reimplemented in FakeTitle.

Definition at line 3672 of file Title.php.

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

Referenced by isValidRedirectTarget(), and userCanRead().

Title::isSpecialPage (  ) 

Returns true if this is a special page.

Reimplemented in FakeTitle.

Definition at line 3664 of file Title.php.

References getNamespace().

Title::isSubpage (  ) 

Is this a subpage?

Returns:
Boolean : : TRUE or FALSE

Reimplemented in FakeTitle.

Definition at line 1631 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 1623 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 493 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 1710 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

Reimplemented in FakeTitle.

Definition at line 2646 of file Title.php.

References $wgUser, File::checkExtensionCompatibility(), equals(), exists(), getArticleID(), getDBkey(), getNamespace(), getNsText(), getUserPermissionsErrors(), isMovable(), isValidMoveTarget(), EditPage::matchSummarySpamRegex(), wfFindFile(), 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

Reimplemented in FakeTitle.

Definition at line 3200 of file Title.php.

References $dbw, 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

Reimplemented in FakeTitle.

Definition at line 3747 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

Reimplemented in FakeTitle.

Definition at line 3242 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 420 of file Title.php.

References $wgLegalTitleChars.

Referenced by languages::getMessagesWithDubiousLinks(), getTitleInvalidRegex(), Parser_LinkHooks::replaceInternalLinks2(), Parser::replaceInternalLinks2(), TitleTest::testLegalChars(), and wfStripIllegalFilenameChars().

Title::loadRestrictions ( oldFashionedRestrictions = null  ) 

Load restrictions from the page_restrictions table.

Reimplemented in FakeTitle.

Definition at line 1966 of file Title.php.

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

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

Title::loadRestrictionsFromResultWrapper ( res,
oldFashionedRestrictions = null 
) [private]

Loads a string into mRestrictions array.

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

Definition at line 1879 of file Title.php.

References $dbr, $res, $rows, loadRestrictionsFromRows(), and wfGetDB().

Referenced by loadRestrictions().

Title::loadRestrictionsFromRows ( rows,
oldFashionedRestrictions = null 
)

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

Make a prefixed DB key from a DB key and a namespace index.

Parameters:
$ns  Integer : : numerical representation of the namespace
$title  String : : the DB key form the title
$fragment  String : : The link fragment (after the "#")
Returns:
String : : the prefixed form of the title

Definition at line 461 of file Title.php.

References $name, $title, and $wgContLang.

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

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 247 of file Title.php.

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

Referenced by SearchResult::__construct(), LinkBatch::addResultToCache(), MediaWiki::articleFromTitle(), ProtectionForm::buildForm(), LocalRepo::checkRedirect(), Orphans::checkSeparation(), compressWithConcat(), Article::confirmDelete(), CategoryViewer::doCategoryQuery(), SpecialTags::doTagRow(), IPUnblockForm::doUnblock(), UpdateSearchIndex::doUpdateSearchIndex(), LinkHolderArray::doVariants(), NukeNS::execute(), DumpSisterSites::execute(), DumpLinks::execute(), CheckBadRedirects::execute(), AttachLatest::execute(), 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(), 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(), AllmessagesTablePager::formatValue(), ParserTest::fuzzTest(), ChangesFeed::generateFeed(), GenerateSitemap::generateLimit(), getBrokenLinksFrom(), User::getCanonicalName(), getCascadeProtectionSources(), IPBlockForm::getConvenienceLinks(), DoubleRedirectJob::getFinalDestination(), Article::getHiddenCategories(), RevDel_LogItem::getHTML(), SpecialExport::getLinks(), getLinksTo(), RecentChange::getMovedToTitle(), MessageCache::getMsgFromNamespace(), SearchEngine::getNearMatchInternal(), ApiQueryInfo::getProtectionInfo(), SpecialMytalk::getRedirect(), SpecialMypage::getRedirect(), File::getRedirectedTitle(), ImagePage::getRedirectTarget(), Article::getRedirectTarget(), ApiPageSet::getRedirectTargets(), RollbackEdits::getRollbackTitles(), LogEventsList::getShowHideLinks(), 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(), LogEventsList::logLine(), GenerateSitemap::main(), newFromIDs(), SquidUpdate::newFromLinksTo(), newFromRow(), OldLocalFile::newFromRow(), ForeignDBFile::newFromRow(), ArchivedFile::newFromRow(), XmlDumpWriter::openPage(), WikiImporter::out_append(), ApiPageSet::processDbRow(), WatchlistCleanup::processRow(), CapsCleanup::processRow(), DeleteDefaultMessages::reallyExecute(), 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(), RecentChange::save(), SpecialAllpages::showChunk(), SpecialRevisionDelete::showForm(), FileDeleteForm::showForm(), SpecialWhatLinksHere::showIndirectLinks(), SpecialPrefixindex::showPrefixChunk(), SpecialUpload::showUploadWarning(), PrefixSearch::specialSearch(), CoreParserFunctions::urlFunction(), Linker::userLink(), Linker::userTalkLink(), ImagePage::view(), wfIsBadImage(), 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 269 of file Title.php.

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

Referenced by UsersPager::__construct(), AllmessagesTablePager::__construct(), ActiveUsersPager::__construct(), UnregisteredLocalFile::__construct(), OutputPage::addCategoryLinks(), Parser::addTrackingCategory(), WatchlistEditor::buildRemoveList(), ImageCleanup::buildSafeTitle(), MovePageForm::doSubmit(), RebuildFileCache::execute(), SpecialExport::execute(), DeletedContributionsPage::execute(), SpecialContributions::execute(), ApiQueryInfo::execute(), SpecialContributions::feed(), RepoGroup::findFile(), FileRepo::findFile(), RepoGroup::findFiles(), SpecialNewpages::form(), Linker::formatAutocommentsCallback(), Linker::formatLinksInCommentCallback(), ShortPagesPage::formatResult(), SpecialMostlinkedtemplates::formatResult(), MostlinkedPage::formatResult(), MostcategoriesPage::formatResult(), FewestrevisionsPage::formatResult(), WantedQueryPage::formatResult(), PageQueryPage::formatResult(), ProtectedTitlesForm::formatRow(), ProtectedPagesForm::formatRow(), SpecialNewpages::formatRow(), Preferences::generateSkinOptions(), UsersPager::getBody(), CategoryPager::getBody(), LinksUpdate::getCategoryInsertions(), OutputPage::getHeadScripts(), SpecialStatistics::getMostViewedPages(), SpecialAllpages::getNamespaceKeyAndText(), ApiBase::getParameterFromSettings(), NewPagesPager::getQueryInfo(), RandomPage::getRandomTitle(), SpecialPage::getSafeTitleFor(), DisambiguationsPage::getSQL(), MergeHistoryPager::getStartBody(), LogPager::getStartBody(), UploadBase::getTitle(), Category::getTitle(), WatchlistEditor::getWatchlist(), WatchlistEditor::getWatchlistInfo(), User::idFromName(), LogPager::limitUser(), 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::processRow(), PatrolLog::record(), NamespaceConflictChecker::reportConflict(), NamespaceConflictChecker::resolveConflict(), NamespaceConflictChecker::resolveConflictOn(), IPBlockForm::setUsernameBitfields(), UndeleteForm::showHistory(), UndeleteForm::showList(), SpecialBookSources::showList(), SpecialAllpages::showToplevel(), SpecialUpload::showViewDeletedLinks(), wfSpecialFilepath(), and wfThumbMain().

Title::moveNoAuth ( &$  nt  ) 

Move this page without authentication.

Parameters:
&$nt  Title : the new page Title

Reimplemented in FakeTitle.

Definition at line 2633 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

Reimplemented in FakeTitle.

Definition at line 2891 of file Title.php.

References $dbw, $urls, $wgContLang, $wgUser, $wgUseSquid, $wgUseTrackbacks, MagicWord::get(), getArticleID(), getLatestRevID(), getPrefixedText(), getSquidURLs(), Revision::newNullRevision(), resetArticleID(), wfGetDB(), 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

Reimplemented in FakeTitle.

Definition at line 3100 of file Title.php.

References $success, $wgMaximumMovedPages, StringUtils::escapeRegexReplacement(), MWNamespace::getCanonicalName(), getDBkey(), 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

Reimplemented in FakeTitle.

Definition at line 2750 of file Title.php.

References $dbw, $wgMessageCache, $wgUser, WatchedItem::duplicateEntries(), getArticleID(), getDBkey(), getNamespace(), getPrefixedDBkey(), getPrefixedText(), isContentPage(), isProtected(), isValidMoveOperation(), moveOverExistingRedirect(), wfGetDB(), wfLocalFile(), 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

Reimplemented in FakeTitle.

Definition at line 3007 of file Title.php.

References $dbw, $wgContLang, $wgUser, $wgUseSquid, MagicWord::get(), getArticleID(), getPrefixedText(), Revision::newNullRevision(), Article::onArticleCreate(), purgeSquid(), resetArticleID(), wfGetDB(), 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 403 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 83 of file Title.php.

References $t.

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

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

Create a new Title from an article ID.

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 188 of file Title.php.

References $title, newFromRow(), and wfGetDB().

Referenced by MediaWiki::checkInitialQueries(), CleanupSpam::cleanupArticle(), ApiMove::execute(), ApiDelete::execute(), RefreshLinks::fixLinksFromArticle(), RefreshLinks::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 204 of file Title.php.

References $dbr, $res, 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 301 of file Title.php.

References newFromRedirectInternal().

Referenced by CheckBadRedirects::execute(), 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 328 of file Title.php.

References $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 365 of file Title.php.

References $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 314 of file Title.php.

References 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 224 of file Title.php.

References $t, and makeTitle().

Referenced by ContribsPager::formatRow(), File::getLinksTo(), getRedirectsHere(), newFromID(), 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 104 of file Title.php.

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

Referenced by DoubleRedirectJob::__construct(), ParserTest::addArticle(), ApiQueryLogEvents::addLogParams(), Skin::addMetadataLinks(), addToSidebar(), ApiFormatXml::addXslt(), ApiQuerySiteinfo::appendGeneralInfo(), ApiQuerySiteinfo::appendRightsInfo(), CoreParserFunctions::basepagename(), CoreParserFunctions::basepagenamee(), Parser::braceSubstitution(), SkinTemplate::buildPersonalUrls(), LocalRepo::checkRedirect(), checkTitle(), ApiFeedWatchlist::createFeedItem(), CoreParserFunctions::displaytitle(), SpecialExport::doExport(), SpecialResetpass::doReturnTo(), drawCategoryBrowser(), Linker::editSectionLinkForOther(), Undelete::execute(), RunJobs::execute(), RollbackEdits::execute(), RebuildTextIndex::execute(), RebuildRecentchanges::execute(), PurgeList::execute(), Protect::execute(), Orphans::execute(), NukePage::execute(), NamespaceConflictChecker::execute(), MoveBatch::execute(), GetTextMaint::execute(), EditCLI::execute(), DeleteBatch::execute(), AddWiki::execute(), SpecialRevisionDelete::execute(), SpecialListGroupRights::execute(), ApiWatch::execute(), ApiUndelete::execute(), ApiRollback::execute(), ApiQueryLogEvents::execute(), ApiPurge::execute(), ApiProtect::execute(), ApiParse::execute(), ApiMove::execute(), ApiExpandTemplates::execute(), ApiEditPage::execute(), ApiDelete::execute(), WatchlistEditor::extractTitles(), DBConnectionError::fileCachedPage(), LanguageConverter::findVariantLink(), footerLink(), Linker::formatAutocommentsCallback(), Parser::formatHeadings(), Linker::formatLinksInCommentCallback(), MIMEsearchPage::formatResult(), FileDuplicateSearchPage::formatResult(), CoreParserFunctions::fullpagename(), CoreParserFunctions::fullpagenamee(), CoreParserFunctions::gender(), User::getCanonicalName(), getCategoryLinks(), getCopyright(), User::getGroupPage(), SpecialStatistics::getGroupStats(), RecentChange::getIRCLine(), SpecialExport::getLinks(), SearchEngine::getNearMatchInternal(), getParentCategoryTree(), EditPage::getPreloadedText(), DisambiguationsPage::getSQL(), SpecialRecentchangeslinked::getTargetTitle(), LogPage::getTitleLink(), SpecialSearch::goResult(), isValidMoveTarget(), User::isValidUserName(), LogPager::limitTitle(), PageArchive::listPagesByPrefix(), LoginForm::LoginForm(), LogEventsList::logLine(), SkinTemplate::makeArticleUrlDetails(), Linker::makeBrokenLink(), Skin::makeGlobalVariablesScript(), makeI18nUrl(), Parser::makeImage(), Linker::makeKnownLink(), makeKnownUrlDetails(), Linker::makeStubLink(), SkinTemplate::makeTalkUrlDetails(), PPFuzzTester::makeTitle(), makeUrl(), makeUrlDetails(), TitleCleanup::moveIllegalPage(), CoreParserFunctions::mwnamespace(), nameAndLogin(), CoreParserFunctions::namespacee(), ImportStreamSource::newFromInterwiki(), newFromRedirectInternal(), newMainPage(), otherLanguages(), WikiImporter::out_append(), SkinTemplate::outputPage(), WikiExporter::pageByName(), CoreParserFunctions::pagename(), CoreParserFunctions::pagenamee(), RdfMetaData::pageOrString(), CoreParserFunctions::pagesize(), ApiQueryBacklinks::processContinue(), WatchlistCleanup::processRow(), TitleCleanup::processRow(), ApiPageSet::processTitlesArray(), SkinStandard::quickBar(), SkinCologneBlue::quickBar(), EnhancedChangesList::recentChangesBlockLine(), OldChangesList::recentChangesLine(), Parser::renderImageGallery(), Parser::replaceInternalLinks2(), Parser_LinkHooks::replaceInternalLinksCallback(), OutputPage::returnToMain(), RdfMetaData::rights(), ApiQueryCategoryMembers::run(), ApiQueryCategories::run(), MWGearmanJob::runNoSwitch(), ParserTest::runTest(), SearchUpdate::SearchUpdate(), Parser::setTitle(), EditPage::showCustomIntro(), SpecialSearch::showInterwikiHit(), SpecialSearch::showResults(), WatchlistEditor::showTitles(), CoreParserFunctions::subjectpagename(), CoreParserFunctions::subjectpagenamee(), CoreParserFunctions::subjectspace(), CoreParserFunctions::subjectspacee(), CoreParserFunctions::subpagename(), CoreParserFunctions::subpagenamee(), subPageSubtitle(), LoginForm::successfulLogin(), SkinCologneBlue::sysLinks(), 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(), wfViewPrevNext(), wlDaysLink(), and wlHoursLink().

static Title::newFromURL ( url  )  [static]

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.

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 162 of file Title.php.

References $t, $url, and $wgLegalTitleChars.

Referenced by ImageListPager::__construct(), MediaWiki::checkInitialQueries(), SpecialRecentchangeslinked::doMainQuery(), SpecialWhatLinksHere::execute(), DBConnectionError::fileCachedPage(), MergehistoryForm::MergehistoryForm(), UndeleteForm::UndeleteForm(), CoreParserFunctions::urlFunction(), and wfSpecialNewimages().

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 3313 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 2208 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 2002 of file Title.php.

References $dbw, and wfGetDB().

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

Title::purgeSquid (  ) 

Purge all applicable Squid URLs.

Reimplemented in FakeTitle.

Definition at line 2620 of file Title.php.

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

Referenced by moveToNewTitle().

Title::quickUserCan ( action  ) 

Can $wgUser 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.

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

Reimplemented in FakeTitle.

Definition at line 1030 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 2172 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:
{} true on success

Definition at line 2264 of file Title.php.

References $wgContLang, $wgLocalInterwiki, capitalize(), getTitleInvalidRegex(), Interwiki::isValidInterwiki(), 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

Reimplemented in FakeTitle.

Definition at line 2473 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 3540 of file Title.php.

References getNamespace().

Title::trackbackRDF (  ) 

Get the trackback RDF for this page.

Returns:
String : : Trackback RDF

Reimplemented in FakeTitle.

Definition at line 3609 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 3598 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

Reimplemented in FakeTitle.

Definition at line 1439 of file Title.php.

References $dbw, $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 1057 of file Title.php.

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

Referenced by moveSubpages(), and quickUserCan().

Title::userCanEditCssSubpage (  ) 

Protect css 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 1747 of file Title.php.

References $wgUser.

Title::userCanEditJsSubpage (  ) 

Protect 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 1759 of file Title.php.

References $wgUser.

Title::userCanRead (  ) 

Can $wgUser read this page?

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

Reimplemented in FakeTitle.

Definition at line 1521 of file Title.php.

References $name, $result, $wgGroupPermissions, $wgRevokePermissions, $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 1004 of file Title.php.

References $wgUser.


Member Data Documentation

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

Definition at line 23 of file Title.php.

Title::$mArticleID = -1

Article ID, fetched from the link cache on demand.

Definition at line 48 of file Title.php.

Title::$mBacklinkCache = null

Cache of links to this title.

Definition at line 66 of file Title.php.

Title::$mCascadeRestriction

Cascade restrictions on this page to included templates and images?

Definition at line 52 of file Title.php.

Title::$mCascadeSources

Where are the cascading restrictions coming from on this page?

Definition at line 55 of file Title.php.

Title::$mDbkeyform = ''

Main part with underscores.

Definition at line 43 of file Title.php.

Title::$mDefaultNamespace = NS_MAIN

Namespace index when there is no namespace.

Definition at line 60 of file Title.php.

Title::$mFragment

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

Definition at line 47 of file Title.php.

Title::$mHasCascadingRestrictions

Are cascading restrictions in effect on this page?

Definition at line 54 of file Title.php.

Title::$mInterwiki = ''

Interwiki prefix (or null string).

Definition at line 46 of file Title.php.

Title::$mLatestID = false

ID of most recent revision.

Definition at line 49 of file Title.php.

Title::$mLength = -1

The page length, 0 for special pages.

Definition at line 63 of file Title.php.

Title::$mNamespace = NS_MAIN

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

Definition at line 45 of file Title.php.

Title::$mNotificationTimestamp = array()

Associative array of user ID -> timestamp/false.

Definition at line 65 of file Title.php.

Title::$mOldRestrictions = false

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

Definition at line 51 of file Title.php.

Title::$mPrefixedText

Text form including namespace/interwiki, initialised on demand.

Definition at line 57 of file Title.php.

Title::$mRedirect = null

Is the article at this title a redirect?

Definition at line 64 of file Title.php.

Title::$mRestrictions = array()

Array of groups allowed to edit this article.

Definition at line 50 of file Title.php.

Title::$mRestrictionsExpiry = array()

When do the restrictions on this page expire?

Definition at line 53 of file Title.php.

Title::$mRestrictionsLoaded = false

Boolean for initialisation on demand.

Definition at line 56 of file Title.php.

Title::$mTextform = ''

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

Definition at line 41 of file Title.php.

Title::$mUrlform = ''

URL-encoded form of the main part.

Definition at line 42 of file Title.php.

Title::$mUserCaseDBKey

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

Definition at line 44 of file Title.php.

Title::$mWatched = null

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

Definition at line 62 of file Title.php.

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

Definition at line 22 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 31 of file Title.php.


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

Generated on Sat Apr 30 22:57:51 2011 for MediaWiki by  doxygen 1.5.9