MediaWiki
REL1_22
|
Represents a title within MediaWiki. More...
Public Member Functions | |
__construct () | |
Constructor. | |
__toString () | |
Return a string representation of this title. | |
areRestrictionsCascading () | |
Returns cascading restrictions for the current article. | |
canExist () | |
Is this in a namespace that allows actual pages? | |
canTalk () | |
Could this title have a corresponding talk page? | |
canUseNoindex () | |
Whether the magic words __INDEX__ and __NOINDEX__ function for this page. | |
countAuthorsBetween ($old, $new, $limit, $options=array()) | |
Get the number of authors between the given revisions or revision IDs. | |
countRevisionsBetween ($old, $new) | |
Get the number of revisions between the given revision. | |
deleteTitleProtection () | |
Remove any title protection due to page existing. | |
equals (Title $title) | |
Compare with another title. | |
escapeCanonicalURL ($query= '', $query2=false) | |
HTML-escaped version of getCanonicalURL() | |
escapeFullURL ($query= '', $query2=false) | |
Get an HTML-escaped version of the URL form, suitable for using in a link, including the server name and fragment. | |
escapeLocalURL ($query= '', $query2=false) | |
Get an HTML-escaped version of the URL form, suitable for using in a link, without a server name or fragment. | |
estimateRevisionCount () | |
Get the approximate revision count of this page. | |
exists () | |
Check if page exists. | |
fixSpecialName () | |
If the Title refers to a special page alias which is not the local default, resolve the alias, and localise the name as necessary. | |
flushRestrictions () | |
Flush the protection cache in this object and force reload from the database. | |
getArticleID ($flags=0) | |
Get the article ID for this Title from the link cache, adding it if necessary. | |
getBacklinkCache () | |
Get a backlink cache object. | |
getBaseText () | |
Get the base page name without a namespace, i.e. | |
getBaseTitle () | |
Get the base page name title, i.e. | |
getBrokenLinksFrom () | |
Get an array of Title objects referring to non-existent articles linked from this page. | |
getCanonicalURL ($query= '', $query2=false) | |
Get the URL for a canonical link, for use in things like IRC and e-mail notifications. | |
getCascadeProtectionSources ($getPages=true) | |
Cascading protection: Get the source of any cascading restrictions on this page. | |
getCategorySortkey ($prefix= '') | |
Returns the raw sort key to be used for categories, with the specified prefix. | |
getContentModel () | |
Get the page's content model id, see the CONTENT_MODEL_XXX constants. | |
getDBkey () | |
Get the main part with underscores. | |
getDefaultMessageText () | |
Get the default message text or false if the message doesn't exist. | |
getDefaultNamespace () | |
Get the default namespace index, for when there is no namespace. | |
getEarliestRevTime ($flags=0) | |
Get the oldest revision timestamp of this page. | |
getEditNotices ($oldid=0) | |
Get a list of rendered edit notices for this page. | |
getEditURL () | |
Get the edit URL for this Title. | |
getEscapedText () | |
Get the HTML-escaped displayable text form. | |
getFirstRevision ($flags=0) | |
Get the first revision of the page. | |
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. | |
getFullText () | |
Get the prefixed title with spaces, plus any fragment (part beginning with '#') | |
getFullURL ($query= '', $query2=false, $proto=PROTO_RELATIVE) | |
Get a real URL referring to this title, with interwiki link and fragment. | |
getIndexTitle () | |
Get title for search index. | |
getInternalURL ($query= '', $query2=false) | |
Get the URL form for an internal link. | |
getInterwiki () | |
Get the interwiki prefix (or null string) | |
getLatestRevID ($flags=0) | |
What is the page_latest field for this page? | |
getLength ($flags=0) | |
What is the length of this page? Uses link cache, adding it if necessary. | |
getLinksFrom ($options=array(), $table= 'pagelinks', $prefix= 'pl') | |
Get an array of Title objects linked from this Title Also stores the IDs in the link cache. | |
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. | |
getLinkURL ($query= '', $query2=false, $proto=PROTO_RELATIVE) | |
Get a URL that's the simplest URL that will be valid to link, locally, to the current Title. | |
getLocalURL ($query= '', $query2=false) | |
Get a URL with no fragment or server name. | |
getNamespace () | |
Get the namespace index, i.e. | |
getNamespaceKey ($prepend= 'nstab-') | |
Generate strings used for xml 'id' names in monobook tabs. | |
getNextRevisionID ($revId, $flags=0) | |
Get the revision ID of the next revision. | |
getNotificationTimestamp ($user=null) | |
Get the timestamp when this page was updated since the user last saw it. | |
getNsText () | |
Get the namespace text. | |
getPageLanguage () | |
Get the language in which the content of this page is written in wikitext. | |
getPageViewLanguage () | |
Get the language in which the content of this page is written when viewed by user. | |
getParentCategories () | |
Get categories to which this Title belongs and return an array of categories' names. | |
getParentCategoryTree ($children=array()) | |
Get a tree of parent categories. | |
getPartialURL () | |
Get the URL-encoded form of the main part. | |
getPrefixedDBkey () | |
Get the prefixed database key form. | |
getPrefixedText () | |
Get the prefixed title with spaces. | |
getPrefixedURL () | |
Get a URL-encoded title (not an actual URL) including interwiki. | |
getPreviousRevisionID ($revId, $flags=0) | |
Get the revision ID of the previous revision. | |
getRedirectsHere ($ns=null) | |
Get all extant redirects to this Title. | |
getRestrictionExpiry ($action) | |
Get the expiry time for the restriction against a given action. | |
getRestrictions ($action) | |
Accessor/initialisation for mRestrictions. | |
getRestrictionTypes () | |
Returns restriction types for the current Title. | |
getRootText () | |
Get the root page name text without a namespace, i.e. | |
getRootTitle () | |
Get the root page name title, i.e. | |
getSkinFromCssJsSubpage () | |
Trim down a .css or .js subpage title to get the corresponding skin name. | |
getSquidURLs () | |
Get a list of URLs to purge from the Squid cache when this page changes. | |
getSubjectNsText () | |
Get the namespace text of the subject (rather than talk) page. | |
getSubjectPage () | |
Get a title object associated with the subject page of this talk page. | |
getSubpage ($text) | |
Get the title for a subpage of the current page. | |
getSubpages ($limit=-1) | |
Get all subpages of this page. | |
getSubpageText () | |
Get the lowest-level subpage name, i.e. | |
getSubpageUrlForm () | |
Get a URL-encoded form of the subpage text. | |
getTalkNsText () | |
Get the namespace text of the talk page. | |
getTalkPage () | |
Get a Title object associated with the talk page of this article. | |
getTemplateLinksFrom ($options=array()) | |
Get an array of Title objects used on this Title as a template 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. | |
getText () | |
Get the text form (spaces not underscores) of the main part. | |
getTouched ($db=null) | |
Get the last touched timestamp. | |
getTransWikiID () | |
Returns the DB name of the distant wiki which owns the object. | |
getUserCaseDBKey () | |
Get the DB key with the initial letter case as specified by the user. | |
getUserPermissionsErrors ($action, $user, $doExpensiveQueries=true, $ignoreErrors=array()) | |
Can $user perform $action on this page? | |
hasContentModel ($id) | |
Convenience method for checking a title's content model name. | |
hasSourceText () | |
Does this page have source text? | |
hasSubjectNamespace ($ns) | |
Returns true if the title has the same subject namespace as the namespace specified. | |
hasSubpages () | |
Does this have subpages? (Warning, usually requires an extra DB query.) | |
inNamespace ($ns) | |
Returns true if the title is inside the specified namespace. | |
inNamespaces () | |
Returns true if the title is inside one of the specified namespaces. | |
invalidateCache () | |
Updates page_touched for this page; called from LinksUpdate.php. | |
isAlwaysKnown () | |
Should links to this title be shown as potentially viewable (i.e. | |
isBigDeletion () | |
Check whether the number of revisions of this page surpasses $wgDeleteRevisionsLimit. | |
isCascadeProtected () | |
Cascading protection: Return true if cascading restrictions apply to this page, false if not. | |
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? | |
isConversionTable () | |
Is this a conversion table for the LanguageConverter? | |
isCssJsSubpage () | |
Is this a .css or .js subpage of a user page? | |
isCssOrJsPage () | |
Could this page contain custom CSS or JavaScript for the global UI. | |
isCssSubpage () | |
Is this a .css subpage of a user page? | |
isDeleted () | |
Is there a version of this page in the deletion archive? | |
isDeletedQuick () | |
Is there a version of this page in the deletion archive? | |
isExternal () | |
Is this Title interwiki? | |
isJsSubpage () | |
Is this a .js subpage of a user page? | |
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). | |
isLocal () | |
Determine whether the object refers to a page within this project. | |
isMainPage () | |
Is this the mainpage? | |
isMovable () | |
Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable. | |
isNamespaceProtected (User $user) | |
Determines if $user is unable to edit this page because it has been protected by $wgNamespaceProtection. | |
isNewPage () | |
Check if this is a new page. | |
isProtected ($action= '') | |
Does the title correspond to a protected article? | |
isRedirect ($flags=0) | |
Is this an article that is a redirect page? Uses link cache, adding it if necessary. | |
isSemiProtected ($action= 'edit') | |
Is this page "semi-protected" - the *only* protection levels are listed in $wgSemiprotectedRestrictionLevels? | |
isSingleRevRedirect () | |
Checks if this page is just a one-rev redirect. | |
isSpecial ($name) | |
Returns true if this title resolves to the named special page. | |
isSpecialPage () | |
Returns true if this is a special page. | |
isSubpage () | |
Is this a subpage? | |
isSubpageOf (Title $title) | |
Check if this title is a subpage of another title. | |
isTalkPage () | |
Is this a talk page of some sort? | |
isTrans () | |
Determine whether the object refers to a page within this project and is transcludable. | |
isValidMoveOperation (&$nt, $auth=true, $reason= '') | |
Check whether a given move operation would be valid. | |
isValidMoveTarget ($nt) | |
Checks if $this can be moved to a given Title. | |
isValidRedirectTarget () | |
Check if this Title is a valid redirect target. | |
isWatchable () | |
Can this title be added to a user's watchlist? | |
isWikitextPage () | |
Does that page contain wikitext, or it is JS, CSS or whatever? | |
loadFromRow ($row) | |
Load Title object fields from a DB row. | |
loadRestrictions ($oldFashionedRestrictions=null) | |
Load restrictions from the page_restrictions table. | |
loadRestrictionsFromRows ($rows, $oldFashionedRestrictions=null) | |
Compiles list of active page restrictions from both page table (pre 1.10) and page_restrictions table for this existing page. | |
moveNoAuth (&$nt) | |
Move this page without authentication. | |
moveSubpages ($nt, $auth=true, $reason= '', $createRedirect=true) | |
Move this page's subpages to be subpages of $nt. | |
moveTo (&$nt, $auth=true, $reason= '', $createRedirect=true) | |
Move a title to a new location. | |
pageCond () | |
Get an associative array for selecting this title from the "page" table. | |
purgeSquid () | |
Purge all applicable Squid URLs. | |
quickUserCan ($action, $user=null) | |
Can $user perform $action on this page? This skips potentially expensive cascading permission checks as well as avoids expensive error formatting. | |
resetArticleID ($newid) | |
This clears some fields in this object, and clears any associated keys in the "bad links" section of the link cache. | |
setFragment ($fragment) | |
Set the fragment for this title. | |
touchLinks () | |
Update page_touched timestamps and send squid purge messages for pages linking to this title. | |
updateTitleProtection ($create_perm, $reason, $expiry) | |
Update the title protection status. | |
userCan ($action, $user=null, $doExpensiveQueries=true) | |
Can $user perform $action on this page? | |
userCanRead () | |
Can $wgUser read this page? | |
userIsWatching () | |
Is $wgUser watching this page? | |
Static Public Member Functions | |
static | capitalize ($text, $ns=NS_MAIN) |
Capitalize a text string for a title if it belongs to a namespace that capitalizes. | |
static | compare ($a, $b) |
Callback for usort() to do title sorts by (namespace, title) | |
static | convertByteClassToUnicodeClass ($byteClass) |
Utility method for converting a character sequence from bytes to Unicode. | |
static | escapeFragmentForURL ($fragment) |
Escape a text fragment, say from a link, for a URL. | |
static | getFilteredRestrictionTypes ($exists=true) |
Get a filtered list of all restriction types supported by this wiki. | |
static | getTitleInvalidRegex () |
Returns a simple regex that will match on characters and sequences invalid in titles. | |
static | indexTitle ($ns, $title) |
Get a string representation of a title suitable for including in a search index. | |
static | legalChars () |
Get a regex character class describing the legal characters in a link. | |
static | makeName ($ns, $title, $fragment= '', $interwiki= '') |
Make a prefixed DB key from a DB key and a namespace index. | |
static & | makeTitle ($ns, $title, $fragment= '', $interwiki= '') |
Create a new Title from a namespace index and a DB key. | |
static | makeTitleSafe ($ns, $title, $fragment= '', $interwiki= '') |
Create a new Title from a namespace index and a DB key. | |
static | nameOf ($id) |
Get the prefixed DB key associated with an ID. | |
static | newFromDBkey ($key) |
Create a new Title from a prefixed DB key. | |
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 | 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 | 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 | 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 | newFromRow ($row) |
Make a Title object from a DB row. | |
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 | newMainPage () |
Create a new Title for the Main Page. | |
static | purgeExpiredRestrictions () |
Purge expired restrictions from the page_restrictions table. | |
Public Attributes | |
const | CACHE_MAX = 1000 |
Title::newFromText maintains a cache to avoid expensive re-normalization of commonly used titles. | |
const | GAID_FOR_UPDATE = 1 |
Used to be GAID_FOR_UPDATE define. | |
Protected Member Functions | |
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. | |
validateFileMoveOperation ($nt) | |
Check if the requested move target is a valid file move target. | |
Static Protected Member Functions | |
static | getSelectFields () |
Returns a list of fields that are to be selected for initializing Title objects or LinkCache entries. | |
Private Member Functions | |
checkActionPermissions ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check action permissions not already checked in checkQuickPermissions. | |
checkCascadingSourcesRestrictions ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check restrictions on cascading pages. | |
checkCSSandJSPermissions ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check CSS/JS sub-page permissions. | |
checkPageRestrictions ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check against page_restrictions table requirements on this page. | |
checkPermissionHooks ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check various permission hooks. | |
checkQuickPermissions ($action, $user, $errors, $doExpensiveQueries, $short) | |
Permissions checks that fail most often, and which are easiest to test. | |
checkReadPermissions ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check that the user is allowed to read this page. | |
checkSpecialsAndNSPermissions ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check permissions on special pages & namespaces. | |
checkUserBlock ($action, $user, $errors, $doExpensiveQueries, $short) | |
Check that the user isn't blocked from editing. | |
getTitleProtection () | |
Is this title subject to title protection? Title protection is the one applied against creation of such title. | |
loadRestrictionsFromResultWrapper ($res, $oldFashionedRestrictions=null) | |
Loads a string into mRestrictions array. | |
missingPermissionError ($action, $short) | |
Get a description array when the user doesn't have the right to perform $action (i.e. | |
moveToInternal (&$nt, $reason= '', $createRedirect=true) | |
Move page to a title which is either a redirect to the source page or nonexistent. | |
prefix ($name) | |
Prefix some arbitrary text with the namespace or interwiki prefix of this object. | |
resultToError ($errors, $result) | |
Add the resulting error code to the errors array. | |
secureAndSplit () | |
Secure and split - main initialisation function for this object. | |
Static Private Member Functions | |
static | fixUrlQueryArgs ($query, $query2=false) |
Helper to fix up the get{Canonical,Full,Link,Local,Internal}URL args get{Canonical,Full,Link,Local,Internal}URL methods accepted an optional second argument named variant. | |
Static Private Attributes | |
Static cache variables | |
static | $titleCache = array() |
Private member variables | |
Please use the accessor functions instead.
| |
$mTextform = '' | |
Cascade restrictions on this page to included templates and images? | |
$mUrlform = '' | |
Cascade restrictions on this page to included templates and images? | |
$mDbkeyform = '' | |
Cascade restrictions on this page to included templates and images? | |
$mUserCaseDBKey | |
Cascade restrictions on this page to included templates and images? | |
$mNamespace = NS_MAIN | |
Cascade restrictions on this page to included templates and images? | |
$mInterwiki = '' | |
Cascade restrictions on this page to included templates and images? | |
$mFragment | |
Cascade restrictions on this page to included templates and images? | |
$mArticleID = -1 | |
Cascade restrictions on this page to included templates and images? | |
$mLatestID = false | |
Cascade restrictions on this page to included templates and images? | |
$mContentModel = false | |
Cascade restrictions on this page to included templates and images? | |
$mRestrictions = array() | |
Cascade restrictions on this page to included templates and images? | |
$mOldRestrictions = false | |
Cascade restrictions on this page to included templates and images? | |
$mCascadeRestriction | |
Cascade restrictions on this page to included templates and images? | |
$mCascadingRestrictions | |
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. | |
$mTitleProtection | |
Cached value for getTitleProtection (create protection) | |
$mDefaultNamespace = NS_MAIN | |
Cascade restrictions on this page to included templates and images? | |
$mWatched = null | |
Cascade restrictions on this page to included templates and images? | |
$mLength = -1 | |
Cascade restrictions on this page to included templates and images? | |
$mRedirect = null | |
Cascade restrictions on this page to included templates and images? | |
$mNotificationTimestamp = array() | |
Cascade restrictions on this page to included templates and images? | |
$mHasSubpage | |
Cascade restrictions on this page to included templates and images? | |
$mEstimateRevisions | |
Cascade restrictions on this page to included templates and images? |
Represents a title within MediaWiki.
Optionally may contain an interwiki designation or namespace.
Return a string representation of this title.
Definition at line 1273 of file Title.php.
References getPrefixedText().
Returns cascading restrictions for the current article.
Reimplemented in FakeTitle.
Definition at line 2684 of file Title.php.
References loadRestrictions().
Title::canExist | ( | ) |
Title::canTalk | ( | ) |
static Title::capitalize | ( | $ | text, |
$ | ns = NS_MAIN |
||
) | [static] |
Capitalize a text string for a title if it belongs to a namespace that capitalizes.
string | $text | containing title to capitalize |
int | $ns | namespace index, defaults to NS_MAIN |
Definition at line 3122 of file Title.php.
References $wgContLang, global, and MWNamespace\isCapitalized().
Referenced by CategoryPager\__construct(), UploadBase\checkWarnings(), WithoutInterwikiPage\execute(), and secureAndSplit().
Title::checkActionPermissions | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check action permissions not already checked in checkQuickPermissions.
string | $action | the action to check |
$user | User to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 2110 of file Title.php.
References $user, $wgLang, array(), getNsText(), getTitleProtection(), getUserPermissionsErrorsInternal(), global, isBigDeletion(), MWNamespace\isMovable(), isMovable(), userCan(), and User\whoIs().
Title::checkCascadingSourcesRestrictions | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check restrictions on cascading pages.
string | $action | the action to check |
$user | User to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 2063 of file Title.php.
References $right, $user, array(), as, getCascadeProtectionSources(), isCssJsSubpage(), and list.
Title::checkCSSandJSPermissions | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check CSS/JS sub-page permissions.
string | $action | the action to check |
$user | User user to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 1993 of file Title.php.
References $user, array(), isCssSubpage(), and isJsSubpage().
Title::checkPageRestrictions | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check against page_restrictions table requirements on this page.
The user must possess all required rights for this action.
string | $action | the action to check |
$user | User user to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 2029 of file Title.php.
References $right, $user, array(), as, and getRestrictions().
Title::checkPermissionHooks | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check various permission hooks.
string | $action | the action to check |
$user | User user to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 1931 of file Title.php.
References $result, $user, array(), resultToError(), and wfRunHooks().
Title::checkQuickPermissions | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Permissions checks that fail most often, and which are easiest to test.
string | $action | the action to check |
$user | User user to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 1844 of file Title.php.
References $user, array(), User\groupHasPermission(), isSubpage(), isTalkPage(), missingPermissionError(), and wfRunHooks().
Title::checkReadPermissions | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check that the user is allowed to read this page.
string | $action | the action to check |
$user | User to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 2204 of file Title.php.
References $name, $user, array(), as, empty, getDBkey(), getNamespace(), getPrefixedDBkey(), getPrefixedText(), SpecialPage\getTitleFor(), global, User\isEveryoneAllowed(), isSpecial(), isSpecialPage(), list, missingPermissionError(), SpecialPageFactory\resolveAlias(), and wfRunHooks().
Title::checkSpecialsAndNSPermissions | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check permissions on special pages & namespaces.
string | $action | the action to check |
$user | User user to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 1964 of file Title.php.
References $user, array(), getNsText(), isNamespaceProtected(), and wfMessage().
Title::checkUserBlock | ( | $ | action, |
$ | user, | ||
$ | errors, | ||
$ | doExpensiveQueries, | ||
$ | short | ||
) | [private] |
Check that the user isn't blocked from editing.
string | $action | the action to check |
$user | User to check | |
array | $errors | list of current errors |
$doExpensiveQueries | Boolean whether or not to perform expensive queries | |
$short | Boolean short circuit on first error |
Definition at line 2169 of file Title.php.
References $user, array(), false, RequestContext\getMain(), and global.
static Title::compare | ( | $ | a, |
$ | b | ||
) | [static] |
Callback for usort() to do title sorts by (namespace, title)
Definition at line 669 of file Title.php.
Referenced by ApiQueryInfo\execute().
static Title::convertByteClassToUnicodeClass | ( | $ | byteClass | ) | [static] |
Utility method for converting a character sequence from bytes to Unicode.
Primary usecase being converting $wgLegalTitleChars to a sequence usable in javascript, as PHP uses UTF-8 bytes where javascript uses Unicode code units.
string | $byteClass |
Definition at line 503 of file Title.php.
References $out.
Referenced by ResourceLoaderStartUpModule\getConfig(), and TitleTest\testConvertByteClassToUnicodeClass().
Title::countAuthorsBetween | ( | $ | old, |
$ | new, | ||
$ | limit, | ||
$ | options = array() |
||
) |
Get the number of authors between the given revisions or revision IDs.
Used for diffs and other things that really need it.
int | Revision | $old | Old revision or rev ID (first before range by default) |
int | Revision | $new | New revision or rev ID (first after range by default) |
int | $limit | Maximum number of authors |
string | array | $options | (Optional): Single option, or an array of options: 'include_old' Include $old in the range; $new is excluded. 'include_new' Include $new in the range; $old is excluded. 'include_both' Include both $old and $new in the range. Unknown option values are ignored. |
Definition at line 4368 of file Title.php.
References $dbr, $limit, $options, $res, array(), getArticleID(), Revision\newFromTitle(), and wfGetDB().
Title::countRevisionsBetween | ( | $ | old, |
$ | new | ||
) |
Get the number of revisions between the given revision.
Used for diffs and other things that really need it.
int | Revision | $old | Old revision or rev ID (first before range) |
int | Revision | $new | New revision or rev ID (first after range) |
Reimplemented in FakeTitle.
Definition at line 4333 of file Title.php.
References $dbr, array(), getArticleID(), Revision\newFromTitle(), and wfGetDB().
Remove any title protection due to page existing.
Reimplemented in FakeTitle.
Definition at line 2449 of file Title.php.
References array(), getDBkey(), getNamespace(), and wfGetDB().
Title::equals | ( | Title $ | title | ) |
Compare with another title.
$title | Title |
Reimplemented in FakeTitle.
Definition at line 4421 of file Title.php.
References getDBkey(), getInterwiki(), and getNamespace().
Referenced by inNamespace(), isMainPage(), and isValidMoveOperation().
Title::escapeCanonicalURL | ( | $ | query = '' , |
$ | query2 = false |
||
) |
HTML-escaped version of getCanonicalURL()
See getLocalURL for the arguments.
Definition at line 1717 of file Title.php.
References $query, getCanonicalURL(), and wfDeprecated().
static Title::escapeFragmentForURL | ( | $ | fragment | ) | [static] |
Escape a text fragment, say from a link, for a URL.
string | $fragment | containing a URL or link fragment (after the "#") |
Definition at line 653 of file Title.php.
References Sanitizer\escapeId().
Referenced by getFragmentForURL().
Title::escapeFullURL | ( | $ | query = '' , |
$ | query2 = false |
||
) |
Get an HTML-escaped version of the URL form, suitable for using in a link, including the server name and fragment.
See getLocalURL for the arguments.
Reimplemented in FakeTitle.
Definition at line 1659 of file Title.php.
References $query, getFullURL(), and wfDeprecated().
Title::escapeLocalURL | ( | $ | query = '' , |
$ | query2 = false |
||
) |
Get an HTML-escaped version of the URL form, suitable for using in a link, without a server name or fragment.
See getLocalURL for the arguments.
$query | string |
$query2 | bool|string |
Reimplemented in FakeTitle.
Definition at line 1644 of file Title.php.
References $query, getLocalURL(), and wfDeprecated().
Get the approximate revision count of this page.
Definition at line 4311 of file Title.php.
References $dbr, array(), exists(), getArticleID(), and wfGetDB().
Referenced by isBigDeletion().
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.
Reimplemented in FakeTitle.
Definition at line 4449 of file Title.php.
References getArticleID().
Referenced by estimateRevisionCount(), getRestrictionTypes(), getTitleProtection(), hasSourceText(), isAlwaysKnown(), isKnown(), isValidMoveOperation(), and loadRestrictions().
If the Title refers to a special page alias which is not the local default, resolve the alias, and localise the name as necessary.
Otherwise, return $this
Reimplemented in FakeTitle.
Definition at line 924 of file Title.php.
References SpecialPageFactory\getLocalNameFor(), isSpecialPage(), list, makeTitle(), and SpecialPageFactory\resolveAlias().
static Title::fixUrlQueryArgs | ( | $ | query, |
$ | query2 = false |
||
) | [static, private] |
Helper to fix up the get{Canonical,Full,Link,Local,Internal}URL args get{Canonical,Full,Link,Local,Internal}URL methods accepted an optional second argument named variant.
This was deprecated in favor of passing an array of option with a "variant" key Once $query2 is removed for good, this helper can be dropped and the wfArrayToCgi moved to getLocalURL();
$query | |
$query2 | bool |
Definition at line 1450 of file Title.php.
References $query, array(), wfArrayToCgi(), and wfDeprecated().
Referenced by getCanonicalURL(), getFullURL(), getInternalURL(), and getLocalURL().
Flush the protection cache in this object and force reload from the database.
This is used when updating protection from WikiPage::doUpdateRestrictions().
Title::getArticleID | ( | $ | flags = 0 | ) |
Get the article ID for this Title from the link cache, adding it if necessary.
int | $flags | a bit field; may be Title::GAID_FOR_UPDATE to select for update |
Reimplemented in FakeTitle.
Definition at line 2982 of file Title.php.
References $flags, getNamespace(), and LinkCache\singleton().
Referenced by ParserOutput\addLink(), countAuthorsBetween(), countRevisionsBetween(), estimateRevisionCount(), exists(), ContentHandler\getAutoDeleteReason(), getBrokenLinksFrom(), getFirstRevision(), getLatestRevID(), getLength(), getLinksFrom(), getNextRevisionID(), getParentCategories(), getPreviousRevisionID(), isRedirect(), isValidMoveOperation(), loadRestrictions(), loadRestrictionsFromRows(), moveSubpages(), moveTo(), moveToInternal(), and InfoAction\pageCounts().
Get a backlink cache object.
Reimplemented in FakeTitle.
Definition at line 4757 of file Title.php.
References BacklinkCache\get().
Get the base page name without a namespace, i.e.
the part before the subpage name
Title::newFromText('User:Foo/Bar/Baz')->getBaseText(); # returns: 'Foo/Bar'
Reimplemented in FakeTitle.
Definition at line 1338 of file Title.php.
References getText(), and MWNamespace\hasSubpages().
Referenced by getBaseTitle().
Get the base page name title, i.e.
the part before the subpage name
Title::newFromText('User:Foo/Bar/Baz')->getBaseTitle(); # returns: Title{User:Foo/Bar}
Definition at line 1363 of file Title.php.
References getBaseText(), getNamespace(), and makeTitle().
Get an array of Title objects referring to non-existent articles linked from this page.
Reimplemented in FakeTitle.
Definition at line 3475 of file Title.php.
References $dbr, $res, array(), as, getArticleID(), makeTitle(), and wfGetDB().
Title::getCanonicalURL | ( | $ | query = '' , |
$ | query2 = false |
||
) |
Get the URL for a canonical link, for use in things like IRC and e-mail notifications.
Uses $wgCanonicalServer and the GetCanonicalURL hook.
NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
See getLocalURL for the arguments.
Definition at line 1700 of file Title.php.
References $query, array(), fixUrlQueryArgs(), getFragmentForURL(), getLocalURL(), wfExpandUrl(), and wfRunHooks().
Referenced by escapeCanonicalURL().
Title::getCascadeProtectionSources | ( | $ | getPages = true | ) |
Cascading protection: Get the source of any cascading restrictions on this page.
bool | $getPages | Whether or not to retrieve the actual pages that the restrictions have come from. |
Reimplemented in FakeTitle.
Definition at line 2560 of file Title.php.
References $dbr, $res, $wgContLang, array(), as, getDBkey(), getNamespace(), global, makeTitle(), purgeExpiredRestrictions(), wfGetDB(), wfProfileIn(), wfProfileOut(), and wfTimestampNow().
Referenced by checkCascadingSourcesRestrictions(), and isCascadeProtected().
Title::getCategorySortkey | ( | $ | prefix = '' | ) |
Returns the raw sort key to be used for categories, with the specified prefix.
This will be fed to Collation::getSortKey() to get a binary sortkey that can be used for actual sorting.
string | $prefix | The prefix to be used, specified using {{defaultsort:}} or like [[Category:Foo|prefix]]. Empty for no prefix. |
Definition at line 4787 of file Title.php.
References array(), getText(), and wfRunHooks().
Get the page's content model id, see the CONTENT_MODEL_XXX constants.
MWException |
Definition at line 789 of file Title.php.
References ContentHandler\getDefaultModelFor(), and LinkCache\singleton().
Referenced by ContentHandler\getForTitle(), hasContentModel(), isValidMoveOperation(), loadFromRow(), and makeTitle().
Title::getDBkey | ( | ) |
Get the main part with underscores.
Reimplemented in FakeTitle.
Definition at line 761 of file Title.php.
Referenced by TitleDependency\__construct(), ParserOutput\addLink(), checkReadPermissions(), LocalRepo\checkRedirect(), deleteTitleProtection(), equals(), SpecialPageFactory\executePath(), Linker\formatAutocommentsCallback(), getCascadeProtectionSources(), getEditNotices(), DoubleRedirectJob\getFinalDestination(), getLinksTo(), getLocalURL(), getNotificationTimestamp(), getRedirectsHere(), getSubjectPage(), getSubpages(), getTalkPage(), getTitleProtection(), WatchAction\getWatchToken(), LocalRepo\invalidateImageRedirect(), isAlwaysKnown(), isDeleted(), isDeletedQuick(), isSingleRevRedirect(), isSpecial(), isSubpageOf(), isValidMoveOperation(), moveSubpages(), moveTo(), ForeignAPIFile\newFromTitle(), Linker\normaliseSpecialPage(), and InfoAction\pageCounts().
Get the default message text or false if the message doesn't exist.
Definition at line 4555 of file Title.php.
References $name, $wgContLang, getNamespace(), global, list, MessageCache\singleton(), and wfMessage().
Title::getEarliestRevTime | ( | $ | flags = 0 | ) |
Get the oldest revision timestamp of this page.
int | $flags | Title::GAID_FOR_UPDATE |
Reimplemented in FakeTitle.
Definition at line 4275 of file Title.php.
References $flags, $rev, and getFirstRevision().
Title::getEditNotices | ( | $ | oldid = 0 | ) |
Get a list of rendered edit notices for this page.
Array is keyed by the original message key, and values are rendered using parseAsBlock, so they will already be wrapped in paragraphs.
int | oldid Revision ID that's being edited |
Definition at line 4868 of file Title.php.
References array(), getDBkey(), getNamespace(), MWNamespace\hasSubpages(), wfMessage(), and wfRunHooks().
Get the HTML-escaped displayable text form.
Used for the title field in tags.
Reimplemented in FakeTitle.
Definition at line 1410 of file Title.php.
References getPrefixedText(), and wfDeprecated().
static Title::getFilteredRestrictionTypes | ( | $ | exists = true | ) | [static] |
Get a filtered list of all restriction types supported by this wiki.
bool | $exists | True to get all restriction types that apply to titles that do exist, False for all restriction types that apply to titles that do not exist |
Definition at line 2351 of file Title.php.
References array(), and global.
Referenced by ApiQueryAllPages\getAllowedParams(), getRestrictionTypes(), and SpecialProtectedpages\getTypeMenu().
Title::getFirstRevision | ( | $ | flags = 0 | ) |
Get the first revision of the page.
int | $flags | Title::GAID_FOR_UPDATE |
Reimplemented in FakeTitle.
Definition at line 4253 of file Title.php.
References $flags, array(), GAID_FOR_UPDATE, getArticleID(), Revision\selectFields(), and wfGetDB().
Referenced by getEarliestRevTime().
Get the Title fragment (i.e. the bit after the #) in text form.
Reimplemented in FakeTitle.
Definition at line 1190 of file Title.php.
Referenced by getLinkURL(), and Linker\normaliseSpecialPage().
Get the fragment in URL form, including the "#" character if there is one.
Reimplemented in FakeTitle.
Definition at line 1198 of file Title.php.
References escapeFragmentForURL().
Referenced by getCanonicalURL(), getFullURL(), and getLinkURL().
Get the prefixed title with spaces, plus any fragment (part beginning with '#')
Reimplemented in FakeTitle.
Definition at line 1283 of file Title.php.
References getPrefixedText().
Referenced by getParentCategories(), WikitextContentHandler\makeRedirectContent(), and WikitextContent\updateRedirect().
Title::getFullURL | ( | $ | query = '' , |
$ | query2 = false , |
||
$ | proto = PROTO_RELATIVE |
||
) |
Get a real URL referring to this title, with interwiki link and fragment.
See getLocalURL for the arguments.
$query | |
$query2 | bool |
$proto | Protocol type to use in URL |
Definition at line 1490 of file Title.php.
References $query, array(), fixUrlQueryArgs(), getFragmentForURL(), getLocalURL(), wfExpandUrl(), and wfRunHooks().
Referenced by escapeFullURL(), SpecialPageFactory\executePath(), FeedUtils\getDiffLink(), and getLinkURL().
Get title for search index.
Reimplemented in FakeTitle.
Definition at line 1181 of file Title.php.
References indexTitle().
Title::getInternalURL | ( | $ | query = '' , |
$ | query2 = false |
||
) |
Get the URL form for an internal link.
This uses $wgInternalServer to qualify the path, or $wgServer if $wgInternalServer is not set. If the server variable used is protocol-relative, the URL will be expanded to http://
See getLocalURL for the arguments.
Reimplemented in FakeTitle.
Definition at line 1678 of file Title.php.
References $query, array(), fixUrlQueryArgs(), getLocalURL(), global, wfExpandUrl(), and wfRunHooks().
Referenced by getSquidURLs().
Get the interwiki prefix (or null string)
Reimplemented in FakeTitle.
Definition at line 707 of file Title.php.
Referenced by equals(), DoubleRedirectJob\getFinalDestination(), getRedirectsHere(), isMovable(), isSubpageOf(), and WikitextContentHandler\makeRedirectContent().
Title::getLatestRevID | ( | $ | flags = 0 | ) |
What is the page_latest field for this page?
int | $flags | a bit field; may be Title::GAID_FOR_UPDATE to select for update |
Reimplemented in FakeTitle.
Definition at line 3066 of file Title.php.
References $flags, GAID_FOR_UPDATE, getArticleID(), and LinkCache\singleton().
Title::getLength | ( | $ | flags = 0 | ) |
What is the length of this page? Uses link cache, adding it if necessary.
int | $flags | a bit field; may be Title::GAID_FOR_UPDATE to select for update |
Reimplemented in FakeTitle.
Definition at line 3040 of file Title.php.
References $flags, getArticleID(), and LinkCache\singleton().
Title::getLinksFrom | ( | $ | options = array() , |
$ | table = 'pagelinks' , |
||
$ | prefix = 'pl' |
||
) |
Get an array of Title objects linked from this Title Also stores the IDs in the link cache.
WARNING: do not use this function on arbitrary user-supplied titles! On heavily-used templates it will max out the memory.
array | $options | may be FOR UPDATE |
string | $table | table name |
string | $prefix | fields prefix |
Definition at line 3404 of file Title.php.
References $options, $res, array(), as, getArticleID(), global, makeTitle(), LinkCache\singleton(), and wfGetDB().
Referenced by getTemplateLinksFrom().
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.
array | $options | may be FOR UPDATE |
string | $table | table name |
string | $prefix | fields prefix |
Reimplemented in FakeTitle.
Definition at line 3346 of file Title.php.
References $options, $res, array(), as, getDBkey(), getNamespace(), makeTitle(), LinkCache\singleton(), and wfGetDB().
Referenced by getTemplateLinksTo().
Title::getLinkURL | ( | $ | query = '' , |
$ | query2 = false , |
||
$ | proto = PROTO_RELATIVE |
||
) |
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.
See getLocalURL for the arguments.
$query | |
$query2 | bool |
$proto | Protocol to use; setting this will cause a full URL to be used |
Definition at line 1619 of file Title.php.
References $query, $ret, getFragment(), getFragmentForURL(), getFullURL(), getLocalURL(), getPrefixedText(), isExternal(), wfProfileIn(), and wfProfileOut().
Title::getLocalURL | ( | $ | query = '' , |
$ | query2 = false |
||
) |
Get a URL with no fragment or server name.
If this page is generated with action=render, $wgServer is prepended.
string | array | $query | 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). Some query patterns will trigger various shorturl path replacements. |
$query2 | Mixed: An optional secondary query array. This one MUST be an array. If a string is passed it will be interpreted as a deprecated variant argument and urlencoded into a variant= argument. This second query argument will be added to the $query The second parameter is deprecated since 1.19. Pass it as a key,value pair in the first parameter array instead. |
Reimplemented in FakeTitle.
Definition at line 1525 of file Title.php.
References $matches, $query, $wgActionPaths, $wgArticlePath, $wgContLang, array(), empty, Interwiki\fetch(), fixUrlQueryArgs(), getDBkey(), getNsText(), getPageLanguage(), getPrefixedDBkey(), global, wfAppendQuery(), wfRunHooks(), and wfUrlencode().
Referenced by escapeLocalURL(), getCanonicalURL(), getEditURL(), getFullURL(), getInternalURL(), getLinkURL(), and Linker\makeThumbLink2().
Get the namespace index, i.e.
one of the NS_xxxx constants.
Reimplemented in FakeTitle.
Definition at line 779 of file Title.php.
Referenced by TitleDependency\__construct(), ParserOutput\addLink(), checkReadPermissions(), deleteTitleProtection(), equals(), WikiPage\factory(), Linker\formatAutocommentsCallback(), getArticleID(), getBaseTitle(), getCascadeProtectionSources(), getDefaultMessageText(), ContentHandler\getDefaultModelFor(), getEditNotices(), DoubleRedirectJob\getFinalDestination(), getLinksTo(), getNamespaceKey(), getNotificationTimestamp(), ContentHandler\getPageLanguage(), ContentHandler\getPageViewLanguage(), getRedirectsHere(), getRestrictionTypes(), getRootTitle(), getSubjectPage(), getSubpage(), getSubpages(), getTalkPage(), getTitleProtection(), hasSubjectNamespace(), inNamespace(), isContentPage(), isConversionTable(), isDeleted(), isDeletedQuick(), isMovable(), isSingleRevRedirect(), isSpecialPage(), isSubpageOf(), isTalkPage(), isValidMoveOperation(), isWatchable(), WikitextContentHandler\makeRedirectContent(), moveSubpages(), moveTo(), InfoAction\pageCounts(), and touchLinks().
Title::getNamespaceKey | ( | $ | prepend = 'nstab-' | ) |
Generate strings used for xml 'id' names in monobook tabs.
string | $prepend | defaults to 'nstab-' |
Reimplemented in FakeTitle.
Definition at line 4668 of file Title.php.
References $wgContLang, MWNamespace\exists(), MWNamespace\getCanonicalName(), getNamespace(), MWNamespace\getSubject(), getSubjectNsText(), and global.
Title::getNextRevisionID | ( | $ | revId, |
$ | flags = 0 |
||
) |
Get the revision ID of the next revision.
int | $revId | Revision ID. Get the revision that was after this one. |
int | $flags | Title::GAID_FOR_UPDATE |
Reimplemented in FakeTitle.
Definition at line 4229 of file Title.php.
References $flags, array(), GAID_FOR_UPDATE, getArticleID(), and wfGetDB().
Title::getNotificationTimestamp | ( | $ | user = null | ) |
Title::getNsText | ( | ) |
Get the namespace text.
Reimplemented in FakeTitle.
Definition at line 821 of file Title.php.
References $wgContLang, MWNamespace\exists(), MWNamespace\getCanonicalName(), getText(), global, MWNamespace\hasGenderDistinction(), and GenderCache\singleton().
Referenced by checkActionPermissions(), checkSpecialsAndNSPermissions(), getLocalURL(), isValidMoveOperation(), and prefix().
Get the language in which the content of this page is written in wikitext.
Defaults to $wgContLang, but in certain cases it can be e.g. $wgLang (such as special pages, which are in the user language).
Definition at line 4814 of file Title.php.
References $wgLang, ContentHandler\getForTitle(), global, isSpecialPage(), and wfGetLangObj().
Referenced by getLocalURL(), and getSquidURLs().
Get the language in which the content of this page is written when viewed by user.
Defaults to $wgContLang, but in certain cases it can be e.g. $wgLang (such as special pages, which are in the user language).
Definition at line 4837 of file Title.php.
References $wgLang, Language\factory(), ContentHandler\getForTitle(), global, and isSpecialPage().
Get categories to which this Title belongs and return an array of categories' names.
Reimplemented in FakeTitle.
Definition at line 4126 of file Title.php.
References $dbr, $res, $wgContLang, array(), as, getArticleID(), getFullText(), global, and wfGetDB().
Referenced by getParentCategoryTree().
Title::getParentCategoryTree | ( | $ | children = array() | ) |
Get a tree of parent categories.
array | $children | with the children in the keys, to check for circular refs |
Reimplemented in FakeTitle.
Definition at line 4161 of file Title.php.
References array(), as, getParentCategories(), and newFromText().
Get the prefixed database key form.
Reimplemented in FakeTitle.
Definition at line 1246 of file Title.php.
Referenced by checkReadPermissions(), DoubleRedirectJob\getFinalDestination(), getLocalURL(), isValidMoveTarget(), and Linker\makeImageLink().
Get the prefixed title with spaces.
This is the form usually used for display
Reimplemented in FakeTitle.
Definition at line 1258 of file Title.php.
References $s, empty, and prefix().
Referenced by __toString(), Linker\buildRollbackLink(), checkReadPermissions(), getEscapedText(), getFullText(), getLinkURL(), getRestrictionTypes(), InfoAction\invalidateCache(), Linker\makeBrokenImageLinkObj(), and moveTo().
Title::getPreviousRevisionID | ( | $ | revId, |
$ | flags = 0 |
||
) |
Get the revision ID of the previous revision.
int | $revId | Revision ID. Get the revision that was before this one. |
int | $flags | Title::GAID_FOR_UPDATE |
Reimplemented in FakeTitle.
Definition at line 4204 of file Title.php.
References $flags, array(), GAID_FOR_UPDATE, getArticleID(), and wfGetDB().
Title::getRedirectsHere | ( | $ | ns = null | ) |
Get all extant redirects to this Title.
int | Null | $ns | Single namespace to consider; NULL to consider all namespaces |
Reimplemented in FakeTitle.
Definition at line 4699 of file Title.php.
References $dbr, $res, array(), as, getDBkey(), getInterwiki(), getNamespace(), isExternal(), newFromRow(), and wfGetDB().
Title::getRestrictionExpiry | ( | $ | action | ) |
Get the expiry time for the restriction against a given action.
$action |
Reimplemented in FakeTitle.
Definition at line 2672 of file Title.php.
References loadRestrictions().
Title::getRestrictions | ( | $ | action | ) |
Accessor/initialisation for mRestrictions.
string | $action | action that permission needs to be checked for |
Reimplemented in FakeTitle.
Definition at line 2656 of file Title.php.
References array(), and loadRestrictions().
Referenced by checkPageRestrictions(), isProtected(), and isSemiProtected().
Returns restriction types for the current Title.
Reimplemented in FakeTitle.
Definition at line 2369 of file Title.php.
References array(), exists(), getFilteredRestrictionTypes(), getNamespace(), getPrefixedText(), isSpecialPage(), wfDebug(), and wfRunHooks().
Referenced by isProtected(), and loadRestrictionsFromRows().
Get the root page name text without a namespace, i.e.
the leftmost part before any slashes
Title::newFromText('User:Foo/Bar/Baz')->getRootText(); # returns: 'Foo'
Definition at line 1303 of file Title.php.
References getText(), and MWNamespace\hasSubpages().
Referenced by getRootTitle().
Get the root page name title, i.e.
the leftmost part before any slashes
Title::newFromText('User:Foo/Bar/Baz')->getRootTitle(); # returns: Title{User:Foo}
Definition at line 1323 of file Title.php.
References getNamespace(), getRootText(), and makeTitle().
static Title::getSelectFields | ( | ) | [static, protected] |
Get a list of URLs to purge from the Squid cache when this page changes.
Reimplemented in FakeTitle.
Definition at line 3511 of file Title.php.
References $urls, array(), as, getInternalURL(), getPageLanguage(), and wfRunHooks().
Referenced by purgeSquid().
Get the namespace text of the subject (rather than talk) page.
Reimplemented in FakeTitle.
Definition at line 850 of file Title.php.
References $wgContLang, MWNamespace\getSubject(), and global.
Referenced by getNamespaceKey().
Get a title object associated with the subject page of this talk page.
Reimplemented in FakeTitle.
Definition at line 1157 of file Title.php.
References getDBkey(), getNamespace(), MWNamespace\getSubject(), and makeTitle().
Title::getSubpage | ( | $ | text | ) |
Get the title for a subpage of the current page.
Title::newFromText('User:Foo/Bar/Baz')->getSubpage("Asdf"); # returns: Title{User:Foo/Bar/Baz/Asdf}
string | $text | The subpage name to add to the title |
Definition at line 1399 of file Title.php.
References getNamespace(), getText(), and makeTitleSafe().
Title::getSubpages | ( | $ | limit = -1 | ) |
Get all subpages of this page.
int | $limit | maximum number of subpages to fetch; -1 for no limit |
Reimplemented in FakeTitle.
Definition at line 2904 of file Title.php.
References $dbr, $limit, $options, array(), getDBkey(), getNamespace(), MWNamespace\hasSubpages(), TitleArray\newFromResult(), and wfGetDB().
Referenced by hasSubpages(), and moveSubpages().
Get the lowest-level subpage name, i.e.
the rightmost part after any slashes
Title::newFromText('User:Foo/Bar/Baz')->getSubpageText(); # returns: "Baz"
Reimplemented in FakeTitle.
Definition at line 1378 of file Title.php.
References MWNamespace\hasSubpages().
Referenced by getSubpageUrlForm().
Get a URL-encoded form of the subpage text.
Reimplemented in FakeTitle.
Definition at line 1420 of file Title.php.
References getSubpageText(), and wfUrlencode().
Get the namespace text of the talk page.
Reimplemented in FakeTitle.
Definition at line 860 of file Title.php.
References $wgContLang, MWNamespace\getTalk(), and global.
Get a Title object associated with the talk page of this article.
Reimplemented in FakeTitle.
Definition at line 1147 of file Title.php.
References getDBkey(), getNamespace(), MWNamespace\getTalk(), and makeTitle().
Title::getTemplateLinksFrom | ( | $ | options = array() | ) |
Get an array of Title objects used on this Title as a template Also stores the IDs in the link cache.
WARNING: do not use this function on arbitrary user-supplied titles! On heavily-used templates it will max out the memory.
array | $options | may be FOR UPDATE |
Definition at line 3465 of file Title.php.
References $options, and getLinksFrom().
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.
array | $options | may be FOR UPDATE |
Reimplemented in FakeTitle.
Definition at line 3388 of file Title.php.
References $options, and getLinksTo().
Title::getText | ( | ) |
Get the text form (spaces not underscores) of the main part.
Reimplemented in FakeTitle.
Definition at line 743 of file Title.php.
Referenced by CategoryViewer\addSubcategoryObject(), getBaseText(), getCategorySortkey(), ContentHandler\getDefaultModelFor(), getNsText(), ContentHandler\getPageLanguage(), getRootText(), getSubpage(), isConversionTable(), isSubpage(), and Linker\makeMediaLinkFile().
static Title::getTitleInvalidRegex | ( | ) | [static] |
Returns a simple regex that will match on characters and sequences invalid in titles.
Note that this doesn't pick up many things that could be wrong with titles, but that replacing this regex with something valid will make many titles valid.
Definition at line 474 of file Title.php.
References character(), is, legalChars(), and URL.
Referenced by secureAndSplit().
Title::getTitleProtection | ( | ) | [private] |
Is this title subject to title protection? Title protection is the one applied against creation of such title.
Definition at line 2396 of file Title.php.
References $dbr, $res, array(), exists(), getDBkey(), getNamespace(), and wfGetDB().
Referenced by checkActionPermissions(), and loadRestrictions().
Title::getTouched | ( | $ | db = null | ) |
Get the last touched timestamp.
$db | DatabaseBase: optional db |
Reimplemented in FakeTitle.
Definition at line 4618 of file Title.php.
References pageCond(), and wfGetDB().
Returns the DB name of the distant wiki which owns the object.
Definition at line 730 of file Title.php.
References Interwiki\fetch().
Title::getUserPermissionsErrors | ( | $ | action, |
$ | user, | ||
$ | doExpensiveQueries = true , |
||
$ | ignoreErrors = array() |
||
) |
Can $user perform $action on this page?
string | $action | action that permission needs to be checked for |
$user | User to check | |
bool | $doExpensiveQueries | Set this to false to avoid doing unnecessary queries by skipping checks for cascading protections and user blocks. |
array | $ignoreErrors | of Strings Set this to a list of message keys whose corresponding errors may be ignored. |
Reimplemented in FakeTitle.
Definition at line 1818 of file Title.php.
References $error, $user, as, and getUserPermissionsErrorsInternal().
Referenced by isValidMoveOperation().
Title::getUserPermissionsErrorsInternal | ( | $ | action, |
$ | user, | ||
$ | doExpensiveQueries = true , |
||
$ | short = false |
||
) | [protected] |
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)
string | $action | action that permission needs to be checked for |
$user | User to check | |
bool | $doExpensiveQueries | Set this to false to avoid doing unnecessary queries. |
bool | $short | Set this to true to stop after the first permission error. |
Definition at line 2311 of file Title.php.
References $user, array(), wfProfileIn(), and wfProfileOut().
Referenced by checkActionPermissions(), getUserPermissionsErrors(), and userCan().
Title::hasContentModel | ( | $ | id | ) |
Convenience method for checking a title's content model name.
string | $id | The content model ID (use the CONTENT_MODEL_XXX constants). |
Definition at line 812 of file Title.php.
References getContentModel().
Referenced by isCssJsSubpage(), isCssOrJsPage(), isCssSubpage(), isJsSubpage(), and isWikitextPage().
Does this page have source text?
Definition at line 4531 of file Title.php.
References $name, $wgContLang, exists(), global, list, MessageCache\singleton(), and wfMessage().
Referenced by isAlwaysKnown().
Title::hasSubjectNamespace | ( | $ | ns | ) |
Returns true if the title has the same subject namespace as the namespace specified.
For example this method will take NS_USER and return true if namespace is either NS_USER or NS_USER_TALK since both of them have NS_USER as their subject namespace.
This is MUCH simpler than individually testing for equivalence against both NS_USER and NS_USER_TALK, and is also forward compatible.
$ns | int |
Definition at line 986 of file Title.php.
References getNamespace(), and MWNamespace\subjectEquals().
Does this have subpages? (Warning, usually requires an extra DB query.)
Reimplemented in FakeTitle.
Definition at line 2876 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.
int | $ns | a namespace index |
string | $title | text-form main part |
Definition at line 604 of file Title.php.
References $t, $title, $wgContLang, global, and SearchEngine\legalSearchChars().
Referenced by getIndexTitle().
Title::inNamespace | ( | $ | ns | ) |
Returns true if the title is inside the specified namespace.
Please make use of this instead of comparing to getNamespace() This function is much more resistant to changes we may make to namespaces than code that makes direct comparisons.
int | $ns | The namespace |
Definition at line 947 of file Title.php.
References equals(), and getNamespace().
Referenced by inNamespaces().
Returns true if the title is inside one of the specified namespaces.
...$namespaces | The namespaces to check for |
Definition at line 958 of file Title.php.
References $namespaces, as, and inNamespace().
Updates page_touched for this page; called from LinksUpdate.php.
Reimplemented in FakeTitle.
Definition at line 4577 of file Title.php.
References array(), pageCond(), wfGetDB(), and wfReadOnly().
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.)
Reimplemented in FakeTitle.
Definition at line 4469 of file Title.php.
References array(), exists(), getDBkey(), hasSourceText(), wfFindFile(), and wfRunHooks().
Referenced by isKnown().
Check whether the number of revisions of this page surpasses $wgDeleteRevisionsLimit.
Definition at line 4295 of file Title.php.
References estimateRevisionCount(), and global.
Referenced by checkActionPermissions().
Cascading protection: Return true if cascading restrictions apply to this page, false if not.
Reimplemented in FakeTitle.
Definition at line 2545 of file Title.php.
References getCascadeProtectionSources(), and list.
Is this Title in a namespace which contains content? In other words, is this a content page, for the purposes of calculating statistics, etc?
Reimplemented in FakeTitle.
Definition at line 997 of file Title.php.
References getNamespace(), and MWNamespace\isContent().
Is this a conversion table for the LanguageConverter?
Reimplemented in FakeTitle.
Definition at line 1048 of file Title.php.
References getNamespace(), and getText().
Is this a .css or .js subpage of a user page?
Reimplemented in FakeTitle.
Definition at line 1092 of file Title.php.
References hasContentModel(), and isSubpage().
Referenced by checkCascadingSourcesRestrictions().
Could this page contain custom CSS or JavaScript for the global UI.
This is generally true for pages in the MediaWiki namespace having CONTENT_MODEL_CSS or CONTENT_MODEL_JAVASCRIPT.
This method does *not* return true for per-user JS/CSS. Use isCssJsSubpage() for that!
Note that this method should not return true for pages that contain and show "inactive" CSS or JS.
Reimplemented in FakeTitle.
Definition at line 1075 of file Title.php.
References array(), hasContentModel(), and wfRunHooks().
Is this a .css subpage of a user page?
Reimplemented in FakeTitle.
Definition at line 1118 of file Title.php.
References hasContentModel(), and isSubpage().
Referenced by checkCSSandJSPermissions().
Title::isDeleted | ( | ) |
Is there a version of this page in the deletion archive?
Reimplemented in FakeTitle.
Definition at line 2931 of file Title.php.
References $dbr, $n, array(), getDBkey(), getNamespace(), and wfGetDB().
Is there a version of this page in the deletion archive?
Reimplemented in FakeTitle.
Definition at line 2956 of file Title.php.
References $dbr, array(), getDBkey(), getNamespace(), and wfGetDB().
Is this Title interwiki?
Reimplemented in FakeTitle.
Definition at line 698 of file Title.php.
Referenced by ParserOutput\addLink(), getLinkURL(), getRedirectsHere(), and isWatchable().
Is this a .js subpage of a user page?
Reimplemented in FakeTitle.
Definition at line 1128 of file Title.php.
References hasContentModel(), and isSubpage().
Referenced by checkCSSandJSPermissions().
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).
Adding something else to this function will cause inconsistency since LinkHolderArray calls isAlwaysKnown() and does its own page existence check.
Reimplemented in FakeTitle.
Definition at line 4522 of file Title.php.
References exists(), and isAlwaysKnown().
Title::isLocal | ( | ) |
Determine whether the object refers to a page within this project.
Reimplemented in FakeTitle.
Definition at line 683 of file Title.php.
References Interwiki\fetch().
Is this the mainpage?
Definition at line 1028 of file Title.php.
References equals(), and newMainPage().
Title::isMovable | ( | ) |
Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable.
Reimplemented in FakeTitle.
Definition at line 1007 of file Title.php.
References $result, array(), getInterwiki(), getNamespace(), MWNamespace\isMovable(), and wfRunHooks().
Referenced by checkActionPermissions(), and isValidMoveOperation().
Title::isNamespaceProtected | ( | User $ | user | ) |
Determines if $user is unable to edit this page because it has been protected by $wgNamespaceProtection.
$user | User object to check permissions |
Reimplemented in FakeTitle.
Definition at line 2527 of file Title.php.
References $right, $wgNamespaceProtection, array(), as, global, and User\isAllowed().
Referenced by checkSpecialsAndNSPermissions().
Title::isNewPage | ( | ) |
Title::isProtected | ( | $ | action = '' | ) |
Does the title correspond to a protected article?
string | $action | the action the page is protected from, by default checks all actions. |
Reimplemented in FakeTitle.
Definition at line 2495 of file Title.php.
References as, getRestrictions(), getRestrictionTypes(), global, and isSpecialPage().
Referenced by moveTo().
Title::isRedirect | ( | $ | flags = 0 | ) |
Is this an article that is a redirect page? Uses link cache, adding it if necessary.
int | $flags | a bit field; may be Title::GAID_FOR_UPDATE to select for update |
Reimplemented in FakeTitle.
Definition at line 3007 of file Title.php.
References $flags, getArticleID(), and LinkCache\singleton().
Referenced by CategoryViewer\addSubcategoryObject().
Title::isSemiProtected | ( | $ | action = 'edit' | ) |
Is this page "semi-protected" - the *only* protection levels are listed in $wgSemiprotectedRestrictionLevels?
string | $action | Action to check (default: edit) |
Reimplemented in FakeTitle.
Definition at line 2467 of file Title.php.
References $key, as, getRestrictions(), and global.
Checks if this page is just a one-rev redirect.
Adds lock, so don't use just for light purposes.
Reimplemented in FakeTitle.
Definition at line 4032 of file Title.php.
References array(), getDBkey(), getNamespace(), global, pageCond(), and wfGetDB().
Title::isSpecial | ( | $ | name | ) |
Returns true if this title resolves to the named special page.
string | $name | The special page name |
Reimplemented in FakeTitle.
Definition at line 908 of file Title.php.
References $name, getDBkey(), isSpecialPage(), list, and SpecialPageFactory\resolveAlias().
Referenced by checkReadPermissions(), and isValidRedirectTarget().
Returns true if this is a special page.
Reimplemented in FakeTitle.
Definition at line 898 of file Title.php.
References getNamespace().
Referenced by SkinTemplate\buildPersonalUrls(), checkReadPermissions(), fixSpecialName(), getPageLanguage(), getPageViewLanguage(), getRestrictionTypes(), isProtected(), isSpecial(), and Linker\normaliseSpecialPage().
Title::isSubpage | ( | ) |
Is this a subpage?
Reimplemented in FakeTitle.
Definition at line 1037 of file Title.php.
References getText(), and hasSubpages().
Referenced by checkQuickPermissions(), isCssJsSubpage(), isCssSubpage(), and isJsSubpage().
Title::isSubpageOf | ( | Title $ | title | ) |
Check if this title is a subpage of another title.
$title | Title |
Definition at line 4434 of file Title.php.
References getDBkey(), getInterwiki(), and getNamespace().
Is this a talk page of some sort?
Reimplemented in FakeTitle.
Definition at line 1138 of file Title.php.
References getNamespace(), and MWNamespace\isTalk().
Referenced by checkQuickPermissions().
Title::isTrans | ( | ) |
Determine whether the object refers to a page within this project and is transcludable.
Reimplemented in FakeTitle.
Definition at line 717 of file Title.php.
References Interwiki\fetch().
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
$nt | Title the new title | |
bool | $auth | indicates whether $wgUser's permissions should be checked |
string | $reason | is the log summary of the move, used for spam checking |
Reimplemented in FakeTitle.
Definition at line 3561 of file Title.php.
References $right, $wgUser, array(), check, empty, equals(), exists(), getArticleID(), getContentModel(), getDBkey(), ContentHandler\getLocalizedName(), getNamespace(), getNsText(), getUserPermissionsErrors(), global, isMovable(), isValidMoveTarget(), EditPage\matchSummarySpamRegex(), validateFileMoveOperation(), wfMergeErrorArrays(), and wfRunHooks().
Referenced by moveTo().
Title::isValidMoveTarget | ( | $ | nt | ) |
Checks if $this can be moved to a given Title.
$nt | Title the new title to check |
Reimplemented in FakeTitle.
Definition at line 4079 of file Title.php.
References $file, $rev, getPrefixedDBkey(), Revision\newFromTitle(), IDBAccessObject\READ_LATEST, wfDebug(), and wfLocalFile().
Referenced by isValidMoveOperation().
Can this title be added to a user's watchlist?
Reimplemented in FakeTitle.
Definition at line 889 of file Title.php.
References getNamespace(), and isExternal().
Does that page contain wikitext, or it is JS, CSS or whatever?
Definition at line 1060 of file Title.php.
References hasContentModel().
static Title::legalChars | ( | ) | [static] |
Get a regex character class describing the legal characters in a link.
Definition at line 462 of file Title.php.
References global.
Referenced by ImageCleanup\buildSafeTitle(), ResourceLoaderStartUpModule\getConfig(), languages\getMessagesWithDubiousLinks(), getTitleInvalidRegex(), Parser\pstPass2(), TitleTest\testLegalChars(), and wfStripIllegalFilenameChars().
Title::loadFromRow | ( | $ | row | ) |
Load Title object fields from a DB row.
If false is given, the title will be treated as non-existing.
$row | Object|bool database row |
Definition at line 290 of file Title.php.
References getContentModel(), and in.
Title::loadRestrictions | ( | $ | oldFashionedRestrictions = null | ) |
Load restrictions from the page_restrictions table.
string | $oldFashionedRestrictions | comma-separated list of page restrictions from page table (pre 1.10) |
Reimplemented in FakeTitle.
Definition at line 2801 of file Title.php.
References $dbr, $res, $wgContLang, array(), exists(), getArticleID(), getTitleProtection(), global, loadRestrictionsFromResultWrapper(), purgeExpiredRestrictions(), wfGetDB(), and wfTimestampNow().
Referenced by areRestrictionsCascading(), getRestrictionExpiry(), and getRestrictions().
Title::loadRestrictionsFromResultWrapper | ( | $ | res, |
$ | oldFashionedRestrictions = null |
||
) | [private] |
Loads a string into mRestrictions array.
$res | Resource restrictions as an SQL result. | |
string | $oldFashionedRestrictions | comma-separated list of page restrictions from page table (pre 1.10) |
Definition at line 2699 of file Title.php.
References $res, array(), as, and loadRestrictionsFromRows().
Referenced by loadRestrictions().
Title::loadRestrictionsFromRows | ( | $ | rows, |
$ | oldFashionedRestrictions = null |
||
) |
Compiles list of active page restrictions from both page table (pre 1.10) and page_restrictions table for this existing page.
Public for usage by LiquidThreads.
array | $rows | of db result objects |
string | $oldFashionedRestrictions | comma-separated list of page restrictions from page table (pre 1.10) |
Reimplemented in FakeTitle.
Definition at line 2718 of file Title.php.
References $dbr, $wgContLang, array(), as, getArticleID(), getRestrictionTypes(), global, purgeExpiredRestrictions(), wfGetDB(), and wfTimestampNow().
Referenced by loadRestrictionsFromResultWrapper().
static Title::makeName | ( | $ | ns, |
$ | title, | ||
$ | fragment = '' , |
||
$ | interwiki = '' |
||
) | [static] |
Make a prefixed DB key from a DB key and a namespace index.
int | $ns | numerical representation of the namespace |
string | $title | the DB key form the title |
string | $fragment | The link fragment (after the "#") |
string | $interwiki | The interwiki prefix |
Definition at line 633 of file Title.php.
References $name, $title, $wgContLang, and global.
Referenced by MovePageForm\doSubmit(), makeTitleSafe(), nameOf(), and TitleCleanup\processRow().
static& Title::makeTitle | ( | $ | ns, |
$ | title, | ||
$ | fragment = '' , |
||
$ | interwiki = '' |
||
) | [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.
int | $ns | the namespace of the article |
string | $title | the unprefixed database key form |
string | $fragment | the link fragment (after the "#") |
string | $interwiki | the interwiki prefix |
Definition at line 331 of file Title.php.
References $t, $title, getContentModel(), in, and wfUrlencode().
Referenced by FakeDimensionFile\__construct(), NewParserTest\addDBData(), LinkBatch\addResultToCache(), ProtectionForm\buildForm(), LocalRepo\checkRedirect(), Orphans\checkSeparation(), CompressOld\compressWithConcat(), SpecialTags\doTagRow(), LinkHolderArray\doVariants(), CheckBadRedirects\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), DeleteDefaultMessages\execute(), DumpSisterSites\execute(), AttachLatest\execute(), FixDoubleRedirects\execute(), DumpLinks\execute(), PurgeChangedPages\execute(), NukeNS\execute(), DeleteEqualMessages\execute(), ApiQueryRandom\extractRowInfo(), ApiQueryWatchlist\extractRowInfo(), ApiQueryContributions\extractRowInfo(), ApiQueryLogEvents\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), ApiFeedContributions\feedItem(), SpecialNewpages\feedItem(), SpecialRecentChanges\filterByCategories(), ForeignAPIRepo\findBySha1(), DoubleRedirectJob\fixRedirects(), fixSpecialName(), FeedUtils\formatDiff(), UncategorizedCategoriesPage\formatResult(), WantedCategoriesPage\formatResult(), UnusedCategoriesPage\formatResult(), UnusedtemplatesPage\formatResult(), AncientPagesPage\formatResult(), BrokenRedirectsPage\formatResult(), ListredirectsPage\formatResult(), DoubleRedirectsPage\formatResult(), MIMEsearchPage\formatResult(), LinkSearchPage\formatResult(), CategoryPager\formatRow(), NewFilesPager\formatRow(), ImageListPager\formatValue(), ChangesFeed\generateFeed(), getBaseTitle(), getBrokenLinksFrom(), getCascadeProtectionSources(), DoubleRedirectJob\getFinalDestination(), RevDel_LogItem\getHTML(), SpecialExport\getLinks(), getLinksFrom(), getLinksTo(), NewUsersLogFormatter\getPreloadTitles(), ApiQueryInfo\getProtectionInfo(), SpecialRandomInCategory\getRandomTitle(), ListredirectsPage\getRedirectTarget(), WikiPage\getRedirectTarget(), RollbackEdits\getRollbackTitles(), getRootTitle(), getSubjectPage(), getTalkPage(), DatabaseLogEntry\getTarget(), RCDatabaseLogEntry\getTarget(), TitleDependency\getTitle(), ResourceLoaderWikiModule\getTitleMtimes(), UserRightsProxy\getUserPage(), MediaWiki\main(), ForeignDBFile\newFromRow(), OldLocalFile\newFromRow(), newFromRow(), PageORMTableForTesting\newRow(), SpecialBlock\postText(), SpecialBlock\processForm(), WatchlistCleanup\processRow(), CapsCleanup\processRow(), SpecialUnblock\processUnblock(), WikitextContentHandlerTest\provideMakeRedirectContent(), GlobalWithDBTest\provideWfIsBadImageList(), PurgeList\purgeNamespace(), LinkHolderArray\replaceInternal(), ApiQueryImages\run(), ApiQueryProtectedTitles\run(), ApiQueryIWBacklinks\run(), ApiQueryLangBacklinks\run(), ApiQueryWatchlistRaw\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryAllCategories\run(), ApiQueryCategoryMembers\run(), ApiQueryPagesWithProp\run(), ApiQueryAllPages\run(), ApiQueryQueryPage\run(), ApiQueryAllImages\run(), ApiQueryLinks\run(), DoubleRedirectJob\run(), ApiQueryAllLinks\run(), ApiQueryRecentChanges\run(), ArticleTest\setUp(), SpecialRevisionDelete\showForm(), SpecialPrefixindex\showPrefixChunk(), NewParserTest\testFuzzTests(), LinksUpdateTest\testUpdate_pagelinks(), CoreParserFunctions\urlFunction(), Linker\userLink(), Linker\userTalkLink(), and wfIsBadImage().
static Title::makeTitleSafe | ( | $ | ns, |
$ | title, | ||
$ | fragment = '' , |
||
$ | interwiki = '' |
||
) | [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.
int | $ns | the namespace of the article |
string | $title | database key form |
string | $fragment | the link fragment (after the "#") |
string | $interwiki | interwiki prefix |
Definition at line 355 of file Title.php.
References $t, $title, MWNamespace\exists(), and makeName().
Referenced by UsersPager\__construct(), ImageCleanup\buildSafeTitle(), MovePageForm\doSubmit(), LinkHolderArray\doVariants(), SpecialContributions\execute(), SpecialExport\execute(), ApiFeedContributions\execute(), ImportSiteScripts\execute(), MovePageForm\execute(), SpecialLog\execute(), RebuildFileCache\execute(), SpecialRandomInCategory\execute(), ApiQueryInfo\execute(), SpecialNewpages\form(), Linker\formatAutocommentsCallback(), Linker\formatLinksInCommentCallback(), PageQueryPage\formatResult(), PopularPagesPage\formatResult(), UnwatchedpagesPage\formatResult(), FewestrevisionsPage\formatResult(), MostlinkedCategoriesPage\formatResult(), ShortPagesPage\formatResult(), MostcategoriesPage\formatResult(), MostinterwikisPage\formatResult(), MostlinkedTemplatesPage\formatResult(), MostlinkedPage\formatResult(), SpecialProtectedtitles\formatRow(), SpecialProtectedpages\formatRow(), ImageListPager\formatValue(), Preferences\generateSkinOptions(), CategoryPager\getBody(), SpecialStatistics\getMostViewedPages(), SpecialEditWatchlist\getNormalForm(), WantedFilesPage\getPageHeader(), ResourceLoaderUserModule\getPages(), RandomPage\getRandomTitle(), LogPager\getStartBody(), MergeHistoryPager\getStartBody(), getSubpage(), SpecialBlock\getTargetUserTitle(), UploadBase\getTitle(), SpecialEditWatchlist\getWatchlist(), LogPager\limitPerformer(), Skin\makeNSUrl(), Linker\makeThumbLink2(), TitleCleanup\moveInconsistentPage(), moveSubpages(), ImageQueryPage\outputResults(), CoreParserFunctions\pagesincategory(), ImageCleanup\processRow(), WikiImporter\processTitle(), RevisionDeleteUser\setUsernameBitfields(), SpecialBookSources\showList(), Preferences\skinPreferences(), CoreParserFunctions\special(), PrefixSearch\specialSearch(), ExtraParserTest\testTrackingCategory(), LinksUpdateTest\testUpdate_iwlinks(), ApiBase\validateUser(), and wfStreamThumb().
Title::missingPermissionError | ( | $ | action, |
$ | short | ||
) | [private] |
Get a description array when the user doesn't have the right to perform $action (i.e.
when User::isAllowed() returns false)
string | $action | the action to check |
$short | Boolean short circuit on first error |
Definition at line 2279 of file Title.php.
References $wgLang, array(), User\getGroupsWithPermission(), and global.
Referenced by checkQuickPermissions(), and checkReadPermissions().
Title::moveNoAuth | ( | &$ | nt | ) |
Title::moveSubpages | ( | $ | nt, |
$ | auth = true , |
||
$ | reason = '' , |
||
$ | createRedirect = true |
||
) |
Move this page's subpages to be subpages of $nt.
$nt | Title Move target | |
bool | $auth | Whether $wgUser's permissions should be checked |
string | $reason | The reason for the move |
bool | $createRedirect | Whether to create redirects from the old subpages to the new ones Ignored if the user doesn't have the 'suppressredirect' right |
Reimplemented in FakeTitle.
Definition at line 3965 of file Title.php.
References $count, $retval, $success, array(), as, bug, StringUtils\escapeRegexReplacement(), getArticleID(), MWNamespace\getCanonicalName(), getDBkey(), getNamespace(), getSubpages(), global, MWNamespace\hasSubpages(), makeTitleSafe(), and userCan().
Title::moveTo | ( | &$ | nt, |
$ | auth = true , |
||
$ | reason = '' , |
||
$ | createRedirect = true |
||
) |
Move a title to a new location.
$nt | Title the new title | |
bool | $auth | indicates whether $wgUser's permissions should be checked |
string | $reason | the reason for the move |
bool | $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 3713 of file Title.php.
References $comment, $file, $wgUser, array(), as, cache, WatchedItem\duplicateEntries(), getArticleID(), getDBkey(), getNamespace(), getPrefixedText(), MWNamespace\getSubject(), global, isProtected(), isValidMoveOperation(), moveToInternal(), Collation\singleton(), RepoGroup\singleton(), was, wfGetDB(), wfLocalFile(), wfMessage(), and wfRunHooks().
Referenced by moveNoAuth().
Title::moveToInternal | ( | &$ | nt, |
$ | reason = '' , |
||
$ | createRedirect = true |
||
) | [private] |
Move page to a title which is either a redirect to the source page or nonexistent.
$nt | Title the page to move to, which should be a redirect or nonexistent | |
string | $reason | The reason for the move |
bool | $createRedirect | Whether to leave a redirect at the old title. Does not check if the user has the suppressredirect right |
MWException |
Definition at line 3831 of file Title.php.
References $comment, $wgContLang, $wgUser, array(), WikiPage\factory(), getArticleID(), ContentHandler\getForTitle(), global, RequestContext\newExtraneousContext(), LogFormatter\newFromEntry(), Revision\newNullRevision(), WikiPage\onArticleCreate(), WikiPage\onArticleDelete(), IDBAccessObject\READ_LOCKING, resetArticleID(), wfGetDB(), wfMessage(), and wfRunHooks().
Referenced by moveTo().
static Title::nameOf | ( | $ | id | ) | [static] |
static Title::newFromDBkey | ( | $ | key | ) | [static] |
Create a new Title from a prefixed DB key.
string | $key | the database key, which has underscores instead of spaces, possibly including namespace and interwiki prefixes |
Definition at line 104 of file Title.php.
Referenced by LinkCache\addLink(), ApiQueryBase\keyToTitle(), and TitleTest\testWgWhitelistReadRegexp().
static Title::newFromID | ( | $ | id, |
$ | flags = 0 |
||
) | [static] |
Create a new Title from an article ID.
int | $id | the page_id corresponding to the Title to create |
int | $flags | use Title::GAID_FOR_UPDATE to use master |
Definition at line 230 of file Title.php.
References $flags, $title, array(), GAID_FOR_UPDATE, newFromRow(), and wfGetDB().
Referenced by CleanupSpam\cleanupArticle(), ApiMove\execute(), SpecialMergeHistory\merge(), and ApiComparePages\revisionOrTitleOrId().
static Title::newFromIDs | ( | $ | ids | ) | [static] |
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.
string | $text | Text with possible redirect |
Definition at line 393 of file Title.php.
References ContentHandler\deprecated(), and ContentHandler\makeContent().
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)
string | $text | Text with possible redirect |
Definition at line 427 of file Title.php.
References ContentHandler\deprecated(), and ContentHandler\makeContent().
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.
string | $text | Text with possible redirect |
Definition at line 410 of file Title.php.
References ContentHandler\deprecated(), and ContentHandler\makeContent().
static Title::newFromRow | ( | $ | row | ) | [static] |
Make a Title object from a DB row.
$row | Object database row (needs at least page_title,page_namespace) |
Definition at line 278 of file Title.php.
References $t, and makeTitle().
Referenced by UpdateCollation\execute(), SpecialPagesWithProp\formatResult(), getRedirectsHere(), newFromID(), newFromIDs(), ApiQueryIWBacklinks\run(), and ApiQueryLangBacklinks\run().
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.
string | $text | the link text; spaces, prefixes, and an initial ':' indicating the main namespace are accepted. |
int | $defaultNamespace | the namespace to use if none is specified by a prefix. If you want to force a specific namespace even if $text might begin with a namespace prefix, use makeTitle() or makeTitleSafe(). |
MWException |
Definition at line 127 of file Title.php.
References $ret, $t, $titleCache, array(), and Sanitizer\decodeCharReferencesAndNormalize().
Referenced by RecentChangeTest\__construct(), PreferencesTest\__construct(), DoubleRedirectJob\__construct(), ImageListPager\__construct(), ImportStreamSource\__construct(), LinkHolderArray\__wakeup(), BackupDumperPageTest\addDBData(), TextPassDumperTest\addDBData(), ApiQueryBasicTest\addDBData(), BackupDumperLoggerTest\addLogEntry(), ApiQueryLogEvents\addLogParams(), Skin\addToSidebarPlain(), ApiFormatXml\addXslt(), ApiQuerySiteinfo\appendRightsInfo(), EditPageTest\assertEdit(), CoreParserFunctions\basepagename(), CoreParserFunctions\basepagenamee(), SkinTemplate\buildPersonalUrls(), SpecialComparePages\checkExistingTitle(), LocalRepo\checkRedirect(), Skin\checkTitle(), ApiFeedWatchlist\createFeedItem(), RevisionStorageTest\createPage(), UploadFromUrlTest\deleteFile(), ApiTestCaseUpload\deleteFileByFileName(), ApiTestCaseUpload\deleteFileByTitle(), CoreParserFunctions\displaytitle(), SpecialExport\doExport(), PurgeList\doPurge(), GenderCache\doTitlesArray(), Skin\drawCategoryBrowser(), ApiUndelete\execute(), ApiMove\execute(), ApiWatch\execute(), Undelete\execute(), ApiExpandTemplates\execute(), ApiQueryAllMessages\execute(), ApiQueryLangLinks\execute(), ApiQueryIWLinks\execute(), MaintenanceFormatInstallDoc\execute(), SpecialChangePassword\execute(), NukePage\execute(), GetTextMaint\execute(), SpecialListGroupRights\execute(), Protect\execute(), RollbackEdits\execute(), ApiQueryLogEvents\execute(), EditCLI\execute(), FixDoubleRedirects\execute(), MovePageForm\execute(), SpecialLog\execute(), Orphans\execute(), DumpIterator\execute(), DeleteBatch\execute(), RebuildTextIndex\execute(), NamespaceConflictChecker\execute(), RunJobs\execute(), MoveBatch\execute(), SpecialRandomInCategory\execute(), CommandLineInstaller\execute(), SpecialRevisionDelete\execute(), UpdateMediaWiki\execute(), FileDuplicateSearchPage\execute(), SpecialEditWatchlist\extractTitles(), Skin\footerLink(), foreach(), Linker\formatAutocommentsCallback(), Linker\formatLinksInCommentCallback(), MIMEsearchPage\formatResult(), CoreParserFunctions\fullpagename(), CoreParserFunctions\fullpagenamee(), CoreParserFunctions\gender(), MoveLogFormatter\getActionLinks(), Skin\getCategoryLinks(), Skin\getCopyright(), SpecialStatistics\getGroupStats(), SkinTemplate\getLanguages(), IRCColourfulRCFeedFormatter\getLine(), SpecialExport\getLinks(), MoveLogFormatter\getMessageParameters(), WantedFilesPage\getPageHeader(), getParentCategoryTree(), MoveLogFormatter\getPreloadTitles(), WikitextContent\getRedirectTarget(), ResourceLoaderWikiModule\getScript(), ParserOutput\getSecondaryDataUpdates(), ResourceLoaderWikiModule\getStyles(), SpecialRecentchangeslinked\getTargetTitle(), CLIParser\getTitle(), UploadBase\getTitle(), ResourceLoaderWikiModule\getTitleMtimes(), ApiBase\getTitleOrPageId(), SearchEngineTest\insertPage(), LogPager\limitTitle(), MediaWiki\main(), SkinTemplate\makeArticleUrlDetails(), Linker\makeBrokenLink(), Skin\makeI18nUrl(), Skin\makeKnownUrlDetails(), MessageCacheTest\makePage(), SkinTemplate\makeTalkUrlDetails(), PPFuzzTester\makeTitle(), LinksUpdateTest\makeTitleAndParserOutput(), Skin\makeUrl(), Skin\makeUrlDetails(), TitleCleanup\moveIllegalPage(), CoreParserFunctions\mwnamespace(), CoreParserFunctions\namespacee(), CoreParserFunctions\namespacenumber(), ForeignAPIFile\newFromTitle(), newMainPage(), WikiPageTest\newPage(), RevisionTest\newTestRevision(), MediaWikiSite\normalizePageName(), CoreParserFunctions\pagename(), CoreParserFunctions\pagenamee(), RdfMetaData\pageOrString(), CoreParserFunctions\pagesize(), WikiImporter\processLogItem(), TitleCleanup\processRow(), WatchlistCleanup\processRow(), WikiImporter\processTitle(), CoreParserFunctions\protectionlevel(), ParserOutput\replaceEditSectionLinksCallback(), ApiComparePages\revisionOrTitleOrId(), SpecialComparePages\revOrTitle(), RdfMetaData\rights(), CoreParserFunctions\rootpagename(), CoreParserFunctions\rootpagenamee(), ApiQueryImages\run(), ApiQueryCategories\run(), ApiQueryLinks\run(), WikiImporter\setTargetRootPage(), TextContentTest\setUp(), ApiOptionsTest\setUp(), SpecialSearch\showResults(), SpecialEditWatchlist\showTitles(), CoreParserFunctions\subjectpagename(), CoreParserFunctions\subjectpagenamee(), CoreParserFunctions\subjectspace(), CoreParserFunctions\subjectspacee(), WebInstaller_Name\submit(), CoreParserFunctions\subpagename(), CoreParserFunctions\subpagenamee(), Skin\subPageSubtitle(), CologneBlueTemplate\sysLinks(), CoreParserFunctions\talkpagename(), CoreParserFunctions\talkpagenamee(), CoreParserFunctions\talkspace(), CoreParserFunctions\talkspacee(), EditPageTest\testAutoMerge(), TagHookTest\testBadFunctionTagHooks(), TagHookTest\testBadTagHooks(), ArticleTablesTest\testbug14404(), TitleTest\testBug31100FixSpecialName(), SpecialPreferencesTest\testBug41337(), ExtraParserTest\testBug8689(), ParserMethodsTest\testCallParserFunction(), ExtraParserTest\testCleanSig(), ExtraParserTest\testCleanSigDisabled(), RevisionTest\testConstructWithContent(), ApiQueryRevisionsTest\testContentComesWithContentModelAndFormat(), TestSample\testCreateBasicListOfTitles(), TextContentTest\testDeletionUpdates(), WikiPageTest\testDoDeleteArticle(), WikiPageTest\testDoEdit(), ApiEditPageTest\testEditAppend(), ApiEditPageTest\testEditConflict(), ApiEditPageTest\testEditConflict_bug41990(), ApiEditPageTest\testEditConflict_redirect(), ApiEditPageTest\testEditNewSection(), ApiEditPageTest\testEditSection(), TitleMethodsTest\testEquals(), TagHookTest\testFunctionTagHooks(), TitleTest\testGetBaseText(), RevisionTest\testGetContentClone(), TitleMethodsTest\testGetContentModel(), ContentHandlerTest\testGetDefaultModelFor(), ContentHandlerTest\testGetForTitle(), ContentHandlerTest\testGetPageLanguage(), TitleTest\testGetPageViewLanguage(), TextContentTest\testGetParserOutput(), ExtraParserTest\testGetPreloadText(), ApiWatchTest\testGetRollbackToken(), TitleTest\testGetRootText(), WikitextContentTest\testGetSecondaryDataUpdates(), ParserMethodsTest\testGetSections(), TitleTest\testGetSubpageText(), TitleMethodsTest\testHasContentModel(), TitleMethodsTest\testHasSubjectNamespace(), TitleMethodsTest\testInNamespace(), TitleMethodsTest\testInNamespaces(), WikiPageTest\testIsCountable(), TitleMethodsTest\testIsCssJsSubpage(), TitleMethodsTest\testIsCssOrJsPage(), TitleMethodsTest\testIsCssSubpage(), TitleMethodsTest\testIsJsSubpage(), TitleTest\testIsValidMoveOperation(), TitleMethodsTest\testIsWikitextPage(), ContentHandlerTest\testMakeContent(), ApiEditPageTest\testNonTextEdit(), ExtraParserTest\testParse(), NewParserTest\testParserTest(), ExtraParserTest\testPreprocess(), ParserMethodsTest\testPreSaveTransform(), ExtraParserTest\testPreSaveTransform(), ApiPurgeTest\testPurgeMainPage(), SpecialSearchTest\testSearchTermIsNotExpanded(), TitleTest\testSecureAndSplit(), TagHookTest\testTagHooks(), TemplateCategoriesTest\testTemplateCategories(), TestSample\testTitleObjectFromObject(), TestSample\testTitleObjectStringConversion(), ApiQueryTest\testTitlesAreRejectedIfInvalid(), ApiQueryTest\testTitlesGetNormalized(), ExtraParserTest\testTrackingCategory(), LinksUpdateTest\testUpdate_langlinks(), LinksUpdateTest\testUpdate_pagelinks(), LinksUpdateTest\testUpdate_templatelinks(), JavaScriptContentTest\testUpdateRedirect(), RequestContextTest\testWikiPageTitle(), PrefixSearch\titleSearch(), ApiQueryBase\titleToKey(), SpecialEditWatchlist\unwatchTitles(), CoreParserFunctions\urlFunction(), SpecialEditWatchlist\watchTitles(), wfIsBadImage(), and wfViewPrevNext().
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.
string | $url | the title, as might be taken from a URL |
Definition at line 184 of file Title.php.
References $t.
Referenced by ImageListPager\__construct(), ImageListPager\buildQueryConds(), SpecialRecentchangeslinked\doMainQuery(), NewFilesPager\getQueryInfo(), and CoreParserFunctions\urlFunction().
static Title::newMainPage | ( | ) | [static] |
Create a new Title for the Main Page.
Definition at line 374 of file Title.php.
References $title, newFromText(), text, and wfMessage().
Referenced by EmaillingJob\__construct(), ApiQuerySiteinfo\appendGeneralInfo(), ApiRsd\execute(), SpecialChangePassword\execute(), Preferences\generateSkinOptions(), ResourceLoaderStartUpModule\getConfig(), isMainPage(), Skin\logoText(), Skin\mainPageLink(), Skin\makeMainPageUrl(), JobQueueTest\newDedupedJob(), JobQueueTest\newJob(), and TestSample\testSetUpMainPageTitleForNextTest().
Title::pageCond | ( | ) |
Get an associative array for selecting this title from the "page" table.
Reimplemented in FakeTitle.
Definition at line 4188 of file Title.php.
References array().
Referenced by getTouched(), invalidateCache(), isNewPage(), and isSingleRevRedirect().
Title::prefix | ( | $ | name | ) | [private] |
Prefix some arbitrary text with the namespace or interwiki prefix of this object.
string | $name | the text |
Definition at line 1228 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 2850 of file Title.php.
References array(), wfGetDB(), and wfReadOnly().
Referenced by SpecialProtectedtitles\execute(), SpecialProtectedpages\execute(), getCascadeProtectionSources(), loadRestrictions(), and loadRestrictionsFromRows().
Title::quickUserCan | ( | $ | action, |
$ | user = null |
||
) |
Can $user perform $action on this page? This skips potentially expensive cascading permission checks as well as avoids expensive error formatting.
Suitable for use for nonessential UI controls in common cases, but _not_ for functional access control.
May provide false positives, but should never provide a false negative.
string | $action | action that permission needs to be checked for |
$user | User to check (since 1.19); $wgUser will be used if not provided. |
Reimplemented in FakeTitle.
Title::resetArticleID | ( | $ | newid | ) |
This clears some fields in this object, and clears any associated keys in the "bad links" section of the link cache.
int | $newid | the new Article ID |
Reimplemented in FakeTitle.
Definition at line 3097 of file Title.php.
References array(), and LinkCache\singleton().
Referenced by moveToInternal().
Title::resultToError | ( | $ | errors, |
$ | result | ||
) | [private] |
Add the resulting error code to the errors array.
array | $errors | list of current errors |
$result | Mixed result of errors |
Definition at line 1903 of file Title.php.
References $result, and array().
Referenced by checkPermissionHooks().
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.
Definition at line 3143 of file Title.php.
References $wgContLang, any, array(), capitalize(), getTitleInvalidRegex(), global, Interwiki\isValidInterwiki(), processing, 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.
string | $fragment | text |
Reimplemented in FakeTitle.
Definition at line 1216 of file Title.php.
Referenced by secureAndSplit().
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 4602 of file Title.php.
References getNamespace().
Title::updateTitleProtection | ( | $ | create_perm, |
$ | reason, | ||
$ | expiry | ||
) |
Update the title protection status.
$create_perm | String Permission required for creation | |
string | $reason | Reason for protection |
string | $expiry | Expiry timestamp |
Reimplemented in FakeTitle.
Definition at line 2431 of file Title.php.
References $limit, $wgUser, array(), WikiPage\factory(), global, and wfDeprecated().
Title::userCan | ( | $ | action, |
$ | user = null , |
||
$ | doExpensiveQueries = true |
||
) |
Can $user perform $action on this page?
string | $action | action that permission needs to be checked for |
$user | User to check (since 1.19); $wgUser will be used if not provided. | |
bool | $doExpensiveQueries | Set this to false to avoid doing unnecessary queries. |
Reimplemented in FakeTitle.
Definition at line 1797 of file Title.php.
References $user, $wgUser, getUserPermissionsErrorsInternal(), and global.
Referenced by checkActionPermissions(), moveSubpages(), quickUserCan(), and userCanRead().
Can $wgUser read this page?
Reimplemented in FakeTitle.
Definition at line 1763 of file Title.php.
References userCan(), and wfDeprecated().
Is $wgUser watching this page?
Reimplemented in FakeTitle.
Title::validateFileMoveOperation | ( | $ | nt | ) | [protected] |
Check if the requested move target is a valid file move target.
Title | $nt | Target title |
Definition at line 3668 of file Title.php.
References $file, $wgUser, array(), File\checkExtensionCompatibility(), global, wfFindFile(), wfLocalFile(), and wfStripIllegalFilenameChars().
Referenced by isValidMoveOperation().
Title::$mArticleID = -1 |
Title::$mCascadeRestriction |
Title::$mCascadeSources |
Title::$mCascadingRestrictions |
Title::$mContentModel = false |
Title::$mDbkeyform = '' |
Title::$mDefaultNamespace = NS_MAIN |
Title::$mEstimateRevisions [private] |
Title::$mFragment |
Title::$mHasCascadingRestrictions |
Title::$mHasSubpage |
Title::$mInterwiki = '' |
Title::$mLatestID = false |
Title::$mLength = -1 |
Title::$mNamespace = NS_MAIN |
Title::$mNotificationTimestamp = array() |
Title::$mOldRestrictions = false |
Title::$mPrefixedText |
Title::$mRedirect = null |
Title::$mRestrictions = array() |
Title::$mRestrictionsExpiry = array() |
Title::$mRestrictionsLoaded = false |
Title::$mTextform = '' |
Title::$mTitleProtection |
Title::$mUrlform = '' |
Title::$mUserCaseDBKey |
Title::$mWatched = null |
Title::$titleCache = array() [static, private] |
Definition at line 36 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 44 of file Title.php.
Referenced by getNotificationTimestamp().
const Title::GAID_FOR_UPDATE = 1 |
Used to be GAID_FOR_UPDATE define.
Used with getArticleID() and friends to use the master DB
Definition at line 50 of file Title.php.
Referenced by getFirstRevision(), getLatestRevID(), getNextRevisionID(), getPreviousRevisionID(), newFromID(), and UploadFromUrlTest\testLeaveMessage().