MediaWiki
1.34.0
|
Represents a title within MediaWiki. More...
Public Attributes | |
const | CACHE_MAX = 1000 |
Title::newFromText maintains a cache to avoid expensive re-normalization of commonly used titles. More... | |
const | GAID_FOR_UPDATE = 512 |
Used to be GAID_FOR_UPDATE define(). More... | |
const | NEW_CLONE = 'clone' |
Flag for use with factory methods like newFromLinkTarget() that have a $forceClone parameter. More... | |
Public Attributes inherited from IDBAccessObject | |
const | READ_LOCKING = self::READ_LATEST | 2 |
Constants for object loading bitfield flags (higher => higher QoS) More... | |
const | READ_NONE = -1 |
Static Private Attributes | |
static MapCacheLRU null | $titleCache = null |
Private member variables | |
Please use the accessor functions instead.
| |
string | $mTextform = '' |
Text form (spaces not underscores) of the main part. More... | |
string | $mUrlform = '' |
URL-encoded form of the main part. More... | |
string | $mDbkeyform = '' |
Main part with underscores. More... | |
int | $mNamespace = NS_MAIN |
Namespace index, i.e. More... | |
string | $mInterwiki = '' |
Interwiki prefix. More... | |
string | $mFragment = '' |
Title fragment (i.e. More... | |
int | $mArticleID = -1 |
Article ID, fetched from the link cache on demand. More... | |
array | $mRestrictions = [] |
Array of groups allowed to edit this article. More... | |
bool | $mCascadeRestriction |
Cascade restrictions on this page to included templates and images? More... | |
$mCascadingRestrictions | |
Caching the results of getCascadeProtectionSources. More... | |
array | $mCascadeSources |
Where are the cascading restrictions coming from on this page? More... | |
bool | $mRestrictionsLoaded = false |
Boolean for initialisation on demand. More... | |
string null | $prefixedText = null |
Text form including namespace/interwiki, initialised on demand. More... | |
mixed | $mTitleProtection |
Cached value for getTitleProtection (create protection) More... | |
int | $mDefaultNamespace = NS_MAIN |
Namespace index when there is no namespace. More... | |
null | $mRedirect = null |
Is the article at this title a redirect? More... | |
string | $mUserCaseDBKey |
Database key with the initial letter in the case specified by the user. More... | |
bool int | $mLatestID = false |
ID of most recent revision. More... | |
string bool | $mOldRestrictions = false |
Comma-separated set of permission keys indicating who can move or edit the page from the page table, (pre 1.10) rows. More... | |
array | $mRestrictionsExpiry = [] |
When do the restrictions on this page expire? More... | |
bool | $mHasCascadingRestrictions |
Are cascading restrictions in effect on this page? More... | |
int | $mLength = -1 |
The page length, 0 for special pages. More... | |
bool | $mLocalInterwiki = false |
Was this Title created from a string with a local interwiki prefix? More... | |
bool string | $mContentModel = false |
ID of the page's content model, i.e. More... | |
bool | $mForcedContentModel = false |
If a content model was forced via setContentModel() this will be true to avoid having other code paths reset it. More... | |
int | $mEstimateRevisions |
Estimated number of revisions; null of not loaded. More... | |
array | $mNotificationTimestamp = [] |
Associative array of user ID -> timestamp/false. More... | |
bool | $mHasSubpages |
Whether a page has any subpages. More... | |
array null | $mPageLanguage |
The (string) language code of the page's language and content code. More... | |
string bool null | $mDbPageLanguage = false |
The page language code from the database, null if not saved in the database or false if not loaded, yet. More... | |
TitleValue null | $mTitleValue = null |
A corresponding TitleValue object. More... | |
bool null | $mIsBigDeletion = null |
Would deleting this page be a big deletion? More... | |
static | getTitleFormatter () |
B/C kludge: provide a TitleParser for use by Title. More... | |
static | getInterwikiLookup () |
B/C kludge: provide an InterwikiLookup for use by Title. More... | |
static | getTitleCache () |
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. More... | |
__construct () | |
loadFromRow ( $row) | |
Load Title object fields from a DB row. More... | |
isValid () | |
Returns true if the title is valid, false if it is invalid. More... | |
isLocal () | |
Determine whether the object refers to a page within this project (either this wiki or a wiki with a local interwiki, see https://www.mediawiki.org/wiki/Manual:Interwiki_table#iw_local ) More... | |
isExternal () | |
Is this Title interwiki? More... | |
getInterwiki () | |
Get the interwiki prefix. More... | |
wasLocalInterwiki () | |
Was this a local interwiki link? More... | |
isTrans () | |
Determine whether the object refers to a page within this project and is transcludable. More... | |
getTransWikiID () | |
Returns the DB name of the distant wiki which owns the object. More... | |
getTitleValue () | |
Get a TitleValue object representing this Title. More... | |
getText () | |
Get the text form (spaces not underscores) of the main part. More... | |
getPartialURL () | |
Get the URL-encoded form of the main part. More... | |
getDBkey () | |
Get the main part with underscores. More... | |
getUserCaseDBKey () | |
Get the DB key with the initial letter case as specified by the user. More... | |
getNamespace () | |
Get the namespace index, i.e. More... | |
getContentModel ( $flags=0) | |
Get the page's content model id, see the CONTENT_MODEL_XXX constants. More... | |
hasContentModel ( $id) | |
Convenience method for checking a title's content model name. More... | |
setContentModel ( $model) | |
Set a proposed content model for the page for permissions checking. More... | |
getNsText () | |
Get the namespace text. More... | |
getSubjectNsText () | |
Get the namespace text of the subject (rather than talk) page. More... | |
getTalkNsText () | |
Get the namespace text of the talk page. More... | |
canHaveTalkPage () | |
Can this title have a corresponding talk page? More... | |
canExist () | |
Is this in a namespace that allows actual pages? More... | |
isWatchable () | |
Can this title be added to a user's watchlist? More... | |
isSpecialPage () | |
Returns true if this is a special page. More... | |
isSpecial ( $name) | |
Returns true if this title resolves to the named special page. More... | |
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. More... | |
inNamespace ( $ns) | |
Returns true if the title is inside the specified namespace. More... | |
inNamespaces (... $namespaces) | |
Returns true if the title is inside one of the specified namespaces. More... | |
hasSubjectNamespace ( $ns) | |
Returns true if the title has the same subject namespace as the namespace specified. More... | |
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? More... | |
isMovable () | |
Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable. More... | |
isMainPage () | |
Is this the mainpage? More... | |
isSubpage () | |
Is this a subpage? More... | |
isConversionTable () | |
Is this a conversion table for the LanguageConverter? More... | |
isWikitextPage () | |
Does that page contain wikitext, or it is JS, CSS or whatever? More... | |
isSiteConfigPage () | |
Could this MediaWiki namespace page contain custom CSS, JSON, or JavaScript for the global UI. More... | |
isUserConfigPage () | |
Is this a "config" (.css, .json, or .js) sub-page of a user page? More... | |
getSkinFromConfigSubpage () | |
Trim down a .css, .json, or .js subpage title to get the corresponding skin name. More... | |
isUserCssConfigPage () | |
Is this a CSS "config" sub-page of a user page? More... | |
isUserJsonConfigPage () | |
Is this a JSON "config" sub-page of a user page? More... | |
isUserJsConfigPage () | |
Is this a JS "config" sub-page of a user page? More... | |
isSiteCssConfigPage () | |
Is this a sitewide CSS "config" page? More... | |
isSiteJsonConfigPage () | |
Is this a sitewide JSON "config" page? More... | |
isSiteJsConfigPage () | |
Is this a sitewide JS "config" page? More... | |
isRawHtmlMessage () | |
Is this a message which can contain raw HTML? More... | |
isTalkPage () | |
Is this a talk page of some sort? More... | |
getTalkPage () | |
Get a Title object associated with the talk page of this article. More... | |
getTalkPageIfDefined () | |
Get a Title object associated with the talk page of this article, if such a talk page can exist. More... | |
getSubjectPage () | |
Get a title object associated with the subject page of this talk page. More... | |
getOtherPage () | |
Get the other title for this page, if this is a subject page get the talk page, if it is a subject page get the talk page. More... | |
getDefaultNamespace () | |
Get the default namespace index, for when there is no namespace. More... | |
getFragment () | |
Get the Title fragment (i.e. More... | |
hasFragment () | |
Check if a Title fragment is set. More... | |
getFragmentForURL () | |
Get the fragment in URL form, including the "#" character if there is one. More... | |
setFragment ( $fragment) | |
Set the fragment for this title. More... | |
createFragmentTarget ( $fragment) | |
Creates a new Title for a different fragment of the same page. More... | |
getPrefixedDBkey () | |
Get the prefixed database key form. More... | |
getPrefixedText () | |
Get the prefixed title with spaces. More... | |
__toString () | |
Return a string representation of this title. More... | |
getFullText () | |
Get the prefixed title with spaces, plus any fragment (part beginning with '#') More... | |
getRootText () | |
Get the root page name text without a namespace, i.e. More... | |
getRootTitle () | |
Get the root page name title, i.e. More... | |
getBaseText () | |
Get the base page name without a namespace, i.e. More... | |
getBaseTitle () | |
Get the base page name title, i.e. More... | |
getSubpageText () | |
Get the lowest-level subpage name, i.e. More... | |
getSubpage ( $text) | |
Get the title for a subpage of the current page. More... | |
getSubpageUrlForm () | |
Get a URL-encoded form of the subpage text. More... | |
getPrefixedURL () | |
Get a URL-encoded title (not an actual URL) including interwiki. More... | |
getFullURL ( $query='', $query2=false, $proto=PROTO_RELATIVE) | |
Get a real URL referring to this title, with interwiki link and fragment. More... | |
getFullUrlForRedirect ( $query='', $proto=PROTO_CURRENT) | |
Get a url appropriate for making redirects based on an untrusted url arg. More... | |
getLocalURL ( $query='', $query2=false) | |
Get a URL with no fragment or server name (relative URL) from a Title object. More... | |
getLinkURL ( $query='', $query2=false, $proto=false) | |
Get a URL that's the simplest URL that will be valid to link, locally, to the current Title. More... | |
getInternalURL ( $query='', $query2=false) | |
Get the URL form for an internal link. More... | |
getCanonicalURL ( $query='', $query2=false) | |
Get the URL for a canonical link, for use in things like IRC and e-mail notifications. More... | |
getEditURL () | |
Get the edit URL for this Title. More... | |
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. More... | |
userCan ( $action, $user=null, $rigor=PermissionManager::RIGOR_SECURE) | |
Can $user perform $action on this page? More... | |
getUserPermissionsErrors ( $action, $user, $rigor=PermissionManager::RIGOR_SECURE, $ignoreErrors=[]) | |
Can $user perform $action on this page? More... | |
getRestrictionTypes () | |
Returns restriction types for the current Title. More... | |
getTitleProtection () | |
Is this title subject to title protection? Title protection is the one applied against creation of such title. More... | |
deleteTitleProtection () | |
Remove any title protection due to page existing. More... | |
isSemiProtected ( $action='edit') | |
Is this page "semi-protected" - the only protection levels are listed in $wgSemiprotectedRestrictionLevels? More... | |
isProtected ( $action='') | |
Does the title correspond to a protected article? More... | |
isNamespaceProtected (User $user) | |
Determines if $user is unable to edit this page because it has been protected by $wgNamespaceProtection. More... | |
isCascadeProtected () | |
Cascading protection: Return true if cascading restrictions apply to this page, false if not. More... | |
areCascadeProtectionSourcesLoaded ( $getPages=true) | |
Determines whether cascading protection sources have already been loaded from the database. More... | |
getCascadeProtectionSources ( $getPages=true) | |
Cascading protection: Get the source of any cascading restrictions on this page. More... | |
areRestrictionsLoaded () | |
Accessor for mRestrictionsLoaded. More... | |
getRestrictions ( $action) | |
Accessor/initialisation for mRestrictions. More... | |
getAllRestrictions () | |
Accessor/initialisation for mRestrictions. More... | |
getRestrictionExpiry ( $action) | |
Get the expiry time for the restriction against a given action. More... | |
areRestrictionsCascading () | |
Returns cascading restrictions for the current article. More... | |
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. More... | |
loadRestrictions ( $oldFashionedRestrictions=null, $flags=0) | |
Load restrictions from the page_restrictions table. More... | |
flushRestrictions () | |
Flush the protection cache in this object and force reload from the database. More... | |
hasSubpages () | |
Does this have subpages? (Warning, usually requires an extra DB query.) More... | |
getSubpages ( $limit=-1) | |
Get all subpages of this page. More... | |
isDeleted () | |
Is there a version of this page in the deletion archive? More... | |
isDeletedQuick () | |
Is there a version of this page in the deletion archive? More... | |
getArticleID ( $flags=0) | |
Get the article ID for this Title from the link cache, adding it if necessary. More... | |
isRedirect ( $flags=0) | |
Is this an article that is a redirect page? Uses link cache, adding it if necessary. More... | |
getLength ( $flags=0) | |
What is the length of this page? Uses link cache, adding it if necessary. More... | |
getLatestRevID ( $flags=0) | |
What is the page_latest field for this page? More... | |
resetArticleID ( $id) | |
Inject a page ID, reset DB-loaded fields, and clear the link cache for this title. More... | |
getLinksTo ( $options=[], $table='pagelinks', $prefix='pl') | |
Get an array of Title objects linking to this Title Also stores the IDs in the link cache. More... | |
getTemplateLinksTo ( $options=[]) | |
Get an array of Title objects using this Title as a template Also stores the IDs in the link cache. More... | |
getLinksFrom ( $options=[], $table='pagelinks', $prefix='pl') | |
Get an array of Title objects linked from this Title Also stores the IDs in the link cache. More... | |
getTemplateLinksFrom ( $options=[]) | |
Get an array of Title objects used on this Title as a template Also stores the IDs in the link cache. More... | |
getBrokenLinksFrom () | |
Get an array of Title objects referring to non-existent articles linked from this page. More... | |
getCdnUrls () | |
Get a list of URLs to purge from the CDN cache when this page changes. More... | |
purgeSquid () | |
Purge all applicable CDN URLs. More... | |
isValidMoveOperation (&$nt, $auth=true, $reason='') | |
Check whether a given move operation would be valid. More... | |
moveTo (&$nt, $auth=true, $reason='', $createRedirect=true, array $changeTags=[]) | |
Move a title to a new location. More... | |
moveSubpages ( $nt, $auth=true, $reason='', $createRedirect=true, array $changeTags=[]) | |
Move this page's subpages to be subpages of $nt. More... | |
isSingleRevRedirect () | |
Locks the page row and check if this page is single revision redirect. More... | |
isValidMoveTarget ( $nt) | |
Checks if $this can be moved to a given Title. More... | |
getParentCategories () | |
Get categories to which this Title belongs and return an array of categories' names. More... | |
getParentCategoryTree ( $children=[]) | |
Get a tree of parent categories. More... | |
pageCond () | |
Get an associative array for selecting this title from the "page" table. More... | |
getPreviousRevisionID ( $revId, $flags=0) | |
Get the revision ID of the previous revision. More... | |
getNextRevisionID ( $revId, $flags=0) | |
Get the revision ID of the next revision. More... | |
getFirstRevision ( $flags=0) | |
Get the first revision of the page. More... | |
getEarliestRevTime ( $flags=0) | |
Get the oldest revision timestamp of this page. More... | |
isNewPage () | |
Check if this is a new page. More... | |
isBigDeletion () | |
Check whether the number of revisions of this page surpasses $wgDeleteRevisionsLimit. More... | |
estimateRevisionCount () | |
Get the approximate revision count of this page. More... | |
countRevisionsBetween ( $old, $new, $max=null) | |
Get the number of revisions between the given revision. More... | |
getAuthorsBetween ( $old, $new, $limit, $options=[]) | |
Get the authors between the given revisions or revision IDs. More... | |
countAuthorsBetween ( $old, $new, $limit, $options=[]) | |
Get the number of authors between the given revisions or revision IDs. More... | |
equals (LinkTarget $title) | |
Compare with another title. More... | |
isSubpageOf (Title $title) | |
Check if this title is a subpage of another title. More... | |
exists ( $flags=0) | |
Check if page exists. More... | |
isAlwaysKnown () | |
Should links to this title be shown as potentially viewable (i.e. More... | |
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). More... | |
hasSourceText () | |
Does this page have source text? More... | |
getDefaultMessageText () | |
Get the default (plain) message contents for an page that overrides an interface message key. More... | |
invalidateCache ( $purgeTime=null) | |
Updates page_touched for this page; called from LinksUpdate.php. More... | |
touchLinks () | |
Update page_touched timestamps and send CDN purge messages for pages linking to this title. More... | |
getTouched ( $db=null) | |
Get the last touched timestamp. More... | |
getNotificationTimestamp ( $user=null) | |
Get the timestamp when this page was updated since the user last saw it. More... | |
getNamespaceKey ( $prepend='nstab-') | |
Generate strings used for xml 'id' names in monobook tabs. More... | |
getRedirectsHere ( $ns=null) | |
Get all extant redirects to this Title. More... | |
isValidRedirectTarget () | |
Check if this Title is a valid redirect target. More... | |
getBacklinkCache () | |
Get a backlink cache object. More... | |
canUseNoindex () | |
Whether the magic words INDEX and NOINDEX function for this page. More... | |
getCategorySortkey ( $prefix='') | |
Returns the raw sort key to be used for categories, with the specified prefix. More... | |
getPageLanguage () | |
Get the language in which the content of this page is written in wikitext. More... | |
getPageViewLanguage () | |
Get the language in which the content of this page is written when viewed by user. More... | |
getEditNotices ( $oldid=0) | |
Get a list of rendered edit notices for this page. More... | |
__sleep () | |
__wakeup () | |
Text form (spaces not underscores) of the main part. More... | |
static | newFromDBkey ( $key) |
Create a new Title from a prefixed DB key. More... | |
static | newFromTitleValue (TitleValue $titleValue, $forceClone='') |
Returns a Title given a TitleValue. More... | |
static | newFromLinkTarget (LinkTarget $linkTarget, $forceClone='') |
Returns a Title given a LinkTarget. More... | |
static | castFromLinkTarget ( $linkTarget) |
Same as newFromLinkTarget, but if passed null, returns null. More... | |
static | newFromText ( $text, $defaultNamespace=NS_MAIN) |
Create a new Title from text, such as what one would find in a link. More... | |
static | newFromTextThrow ( $text, $defaultNamespace=NS_MAIN) |
Like Title::newFromText(), but throws MalformedTitleException when the title is invalid, rather than returning null. More... | |
static | newFromURL ( $url) |
THIS IS NOT THE FUNCTION YOU WANT. More... | |
static | newFromID ( $id, $flags=0) |
Create a new Title from an article ID. More... | |
static | newFromIDs ( $ids) |
Make an array of titles from an array of IDs. More... | |
static | newFromRow ( $row) |
Make a Title object from a DB row. More... | |
static | makeTitle ( $ns, $title, $fragment='', $interwiki='') |
Create a new Title from a namespace index and a DB key. More... | |
static | makeTitleSafe ( $ns, $title, $fragment='', $interwiki='') |
Create a new Title from a namespace index and a DB key. More... | |
static | newMainPage (MessageLocalizer $localizer=null) |
Create a new Title for the Main Page. More... | |
static | nameOf ( $id) |
Get the prefixed DB key associated with an ID. More... | |
static | legalChars () |
Get a regex character class describing the legal characters in a link. More... | |
static | convertByteClassToUnicodeClass ( $byteClass) |
Utility method for converting a character sequence from bytes to Unicode. More... | |
static | makeName ( $ns, $title, $fragment='', $interwiki='', $canonicalNamespace=false) |
Make a prefixed DB key from a DB key and a namespace index. More... | |
static | compare (LinkTarget $a, LinkTarget $b) |
Callback for usort() to do title sorts by (namespace, title) More... | |
static | getFilteredRestrictionTypes ( $exists=true) |
Get a filtered list of all restriction types supported by this wiki. More... | |
static | purgeExpiredRestrictions () |
Purge expired restrictions from the page_restrictions table. More... | |
static | clearCaches () |
Text form (spaces not underscores) of the main part. More... | |
static | capitalize ( $text, $ns=NS_MAIN) |
Capitalize a text string for a title if it belongs to a namespace that capitalizes. More... | |
static | getSelectFields () |
Returns a list of fields that are to be selected for initializing Title objects or LinkCache entries. More... | |
lazyFillContentModel ( $model) | |
If the content model field is not frozen then update it with a retreived value. More... | |
warnIfPageCannotExist (Title $title, $method) | |
prefix ( $name) | |
Prefix some arbitrary text with the namespace or interwiki prefix of this object. More... | |
secureAndSplit () | |
Secure and split - main initialisation function for this object. More... | |
getRelativeRevisionID ( $revId, $flags, $dir) | |
Get next/previous revision ID relative to another revision ID. More... | |
getDbPageLanguageCode () | |
Returns the page language code saved in the database, if $wgPageLanguageUseDB is set to true in LocalSettings.php, otherwise returns false. More... | |
loadFieldFromDB ( $field, $flags) | |
getTitleProtectionInternal () | |
Fetch title protection settings. More... | |
Additional Inherited Members |
Represents a title within MediaWiki.
Optionally may contain an interwiki designation or namespace.
Title::__toString | ( | ) |
Return a string representation of this title.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 1832 of file Title.php.
References getPrefixedText().
Title::__wakeup | ( | ) |
Text form (spaces not underscores) of the main part.
Definition at line 4780 of file Title.php.
References wfUrlencode().
Title::areCascadeProtectionSourcesLoaded | ( | $getPages = true | ) |
Determines whether cascading protection sources have already been loaded from the database.
bool | $getPages | True to check if the pages are loaded, or false to check if the status is loaded. |
Title::areRestrictionsCascading | ( | ) |
Returns cascading restrictions for the current article.
Definition at line 2796 of file Title.php.
References $mCascadeRestriction, and loadRestrictions().
Title::areRestrictionsLoaded | ( | ) |
Accessor for mRestrictionsLoaded.
Definition at line 2743 of file Title.php.
References $mRestrictionsLoaded.
Title::canExist | ( | ) |
Is this in a namespace that allows actual pages?
Definition at line 1186 of file Title.php.
References NS_MAIN.
Referenced by RequestContext\canUseWikiPage(), and SpecialCiteThisPage\prefixSearchSubpages().
Title::canHaveTalkPage | ( | ) |
Can this title have a corresponding talk page?
False for relative section links (with getText() === ''), interwiki links (with getInterwiki() !== ''), and pages in NS_SPECIAL.
Definition at line 1177 of file Title.php.
Referenced by getOtherPage(), and getTalkPageIfDefined().
Title::canUseNoindex | ( | ) |
Whether the magic words INDEX and NOINDEX function for this page.
Definition at line 4525 of file Title.php.
References $wgExemptFromUserRobotsControl.
|
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 3280 of file Title.php.
Referenced by CategoryPager\__construct(), and SpecialWithoutInterwiki\execute().
|
static |
Same as newFromLinkTarget, but if passed null, returns null.
LinkTarget | null | $linkTarget | Assumed to be safe (if not null). |
Definition at line 292 of file Title.php.
References newFromLinkTarget().
Referenced by Linker\formatAutocomments(), Linker\getUploadUrl(), Linker\makeBrokenImageLinkObj(), Linker\makeMediaLinkFile(), and WatchedItemStore\resetNotificationTimestamp().
|
static |
Text form (spaces not underscores) of the main part.
Definition at line 3265 of file Title.php.
References $titleCache, MapCacheLRU\clear(), and getTitleCache().
Referenced by ImportableOldRevisionImporter\import().
|
static |
Callback for usort() to do title sorts by (namespace, title)
LinkTarget | $a | |
LinkTarget | $b |
Definition at line 841 of file Title.php.
References MediaWiki\Linker\LinkTarget\getNamespace(), and MediaWiki\Linker\LinkTarget\getText().
Referenced by ApiQueryInfo\execute().
|
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 709 of file Title.php.
Referenced by ResourceLoaderStartUpModule\getConfigSettings().
Title::countAuthorsBetween | ( | $old, | |
$new, | |||
$limit, | |||
$options = [] |
|||
) |
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 4102 of file Title.php.
References getAuthorsBetween().
Title::countRevisionsBetween | ( | $old, | |
$new, | |||
$max = null |
|||
) |
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) |
int | null | $max | Limit of Revisions to count, will be incremented to detect truncations |
Definition at line 3983 of file Title.php.
References $dbr, DB_REPLICA, getArticleID(), Revision\newFromTitle(), and wfGetDB().
Title::createFragmentTarget | ( | $fragment | ) |
Creates a new Title for a different fragment of the same page.
string | $fragment |
Implements MediaWiki\Linker\LinkTarget.
Definition at line 1764 of file Title.php.
References getText(), and makeTitle().
Title::deleteTitleProtection | ( | ) |
Title::equals | ( | LinkTarget | $title | ) |
Compare with another title.
LinkTarget | $title |
Definition at line 4113 of file Title.php.
References $title.
Referenced by Scribunto_LuaTitleLibrary\getInexpensiveTitleData(), getLocalURL(), inNamespace(), isMainPage(), MediaWiki\Block\Restriction\PageRestriction\matches(), MediaWiki\Storage\DerivedPageDataUpdater\prepareContent(), and Revision\RenderedRevision\setRevisionInternal().
Title::estimateRevisionCount | ( | ) |
Get the approximate revision count of this page.
Definition at line 3960 of file Title.php.
References $dbr, $mEstimateRevisions, DB_REPLICA, exists(), getArticleID(), and wfGetDB().
Title::exists | ( | $flags = 0 | ) |
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.
int | $flags | Either a bitfield of class READ_* constants or GAID_FOR_UPDATE |
Definition at line 4142 of file Title.php.
References getArticleID(), and Hooks\run().
Referenced by estimateRevisionCount(), getRestrictionTypes(), getTitleProtectionInternal(), SpecialUpload\getUploadForm(), hasSourceText(), isKnown(), makeTitleSafe(), and UppercaseTitlesForUnicodeTransition\mungeTitle().
Title::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.
Otherwise, return $this
Definition at line 1237 of file Title.php.
References isSpecialPage(), makeTitle(), and NS_SPECIAL.
|
staticprivate |
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();
array | string | $query | |
string | string[] | bool | $query2 |
Definition at line 2030 of file Title.php.
References wfArrayToCgi(), and wfDeprecated().
Referenced by getCanonicalURL(), getFullURL(), getInternalURL(), and getLocalURL().
Title::flushRestrictions | ( | ) |
Flush the protection cache in this object and force reload from the database.
This is used when updating protection from WikiPage::doUpdateRestrictions().
Title::getAllRestrictions | ( | ) |
Accessor/initialisation for mRestrictions.
Definition at line 2770 of file Title.php.
References $mRestrictions, and loadRestrictions().
Title::getArticleID | ( | $flags = 0 | ) |
Get the article ID for this Title from the link cache, adding it if necessary.
int | $flags | Either a bitfield of class READ_* constants or GAID_FOR_UPDATE |
Definition at line 3126 of file Title.php.
References $mArticleID, DBAccessObjectUtils\hasFlags(), and loadFieldFromDB().
Referenced by MergeHistoryPager\__construct(), countRevisionsBetween(), estimateRevisionCount(), exists(), getAuthorsBetween(), getBrokenLinksFrom(), getContentModel(), getFirstRevision(), getLatestRevID(), getLength(), getLinksFrom(), getParentCategories(), isBigDeletion(), isRedirect(), loadRestrictions(), NamespaceDupes\mergePage(), RecentChange\newForCategorization(), and CategoryMembershipChangeJob\newSpec().
Title::getAuthorsBetween | ( | $old, | |
$new, | |||
$limit, | |||
$options = [] |
|||
) |
Get the 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 4026 of file Title.php.
References $dbr, $revQuery, DB_REPLICA, getArticleID(), Revision\getQueryInfo(), Revision\newFromTitle(), and wfGetDB().
Referenced by countAuthorsBetween().
Title::getBacklinkCache | ( | ) |
Get a backlink cache object.
Definition at line 4516 of file Title.php.
References BacklinkCache\get().
Title::getBaseText | ( | ) |
Get the base page name without a namespace, i.e.
the part before the subpage name
Definition at line 1912 of file Title.php.
References getText(), and hasSubpages().
Referenced by getBaseTitle().
Title::getBaseTitle | ( | ) |
Get the base page name title, i.e.
the part before the subpage name.
Definition at line 1942 of file Title.php.
References $title, getBaseText(), and makeTitleSafe().
Title::getBrokenLinksFrom | ( | ) |
Get an array of Title objects referring to non-existent articles linked from this page.
Definition at line 3468 of file Title.php.
References $dbr, $res, DB_REPLICA, 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
string | array | $query | |
string | bool | $query2 | Deprecated |
Definition at line 2292 of file Title.php.
References fixUrlQueryArgs(), getFragmentForURL(), getLocalURL(), PROTO_CANONICAL, Hooks\run(), and wfExpandUrl().
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 and the actual restrictions themselves. |
Definition at line 2657 of file Title.php.
References $dbr, $mCascadeSources, $mCascadingRestrictions, $mDbkeyform, $mHasCascadingRestrictions, $mNamespace, $res, DB_REPLICA, makeTitle(), NS_FILE, wfGetDB(), and wfTimestampNow().
Referenced by 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 4544 of file Title.php.
References getText(), and Hooks\run().
Referenced by CategoryViewer\doCategoryQuery().
Title::getCdnUrls | ( | ) |
Get a list of URLs to purge from the CDN cache when this page changes.
Definition at line 3504 of file Title.php.
References getInternalURL(), getPageLanguage(), isUserCssConfigPage(), isUserJsConfigPage(), isUserJsonConfigPage(), and Hooks\run().
Referenced by HTMLCacheUpdateJob\invalidateTitles(), MediaWiki\performAction(), and purgeSquid().
Title::getContentModel | ( | $flags = 0 | ) |
Get the page's content model id, see the CONTENT_MODEL_XXX constants.
int | $flags | Either a bitfield of class READ_* constants or GAID_FOR_UPDATE |
Definition at line 1049 of file Title.php.
References $mContentModel, getArticleID(), ContentHandler\getDefaultModelFor(), DBAccessObjectUtils\hasFlags(), lazyFillContentModel(), and loadFieldFromDB().
Referenced by MediaWiki\EditPage\TextConflictHelper\__construct(), SpecialChangeContentModel\getOptionsForTitle(), and hasContentModel().
Title::getDBkey | ( | ) |
Get the main part with underscores.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 1013 of file Title.php.
References $mDbkeyform.
Referenced by JobSpecification\__construct(), ArchivedFile\__construct(), Job\__construct(), CategoryViewer\addFragmentToTitle(), DoubleRedirectJob\fixRedirects(), DoubleRedirectJob\getFinalDestination(), CategoryViewer\getSubcategorySortChar(), WikiPage\insertRedirectEntry(), isRawHtmlMessage(), LogPager\limitTitle(), PageArchive\listPagesByPrefix(), PageArchive\listPagesBySearch(), RecentChange\newForCategorization(), ForeignAPIFile\newFromTitle(), RefreshLinks\refreshCategory(), SpecialWhatLinksHere\showIndirectLinks(), and MessageCache\updateMessageOverride().
|
private |
Returns the page language code saved in the database, if $wgPageLanguageUseDB is set to true in LocalSettings.php, otherwise returns false.
If there is no language saved in the db, it will return NULL.
Definition at line 4570 of file Title.php.
References $mDbPageLanguage, and $wgPageLanguageUseDB.
Referenced by getPageLanguage(), and getPageViewLanguage().
Title::getDefaultMessageText | ( | ) |
Get the default (plain) message contents for an page that overrides an interface message key.
Primary use cases:
Definition at line 4285 of file Title.php.
References $lang, getText(), NS_MEDIAWIKI, MessageCache\singleton(), and wfMessage().
Title::getDefaultNamespace | ( | ) |
Get the default namespace index, for when there is no namespace.
Definition at line 1696 of file Title.php.
References $mDefaultNamespace.
Title::getEarliestRevTime | ( | $flags = 0 | ) |
Get the oldest revision timestamp of this page.
int | $flags | Bitfield of class READ_* constants |
Definition at line 3911 of file Title.php.
References 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 4674 of file Title.php.
References $mNamespace, hasSubpages(), Hooks\run(), and wfMessage().
Title::getEditURL | ( | ) |
Get the edit URL for this Title.
Definition at line 2306 of file Title.php.
References $s, getLocalURL(), and isExternal().
|
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 2413 of file Title.php.
References $wgRestrictionTypes.
Referenced by ApiQueryAllPages\getAllowedParams(), getRestrictionTypes(), and SpecialProtectedpages\getTypeMenu().
Title::getFirstRevision | ( | $flags = 0 | ) |
Get the first revision of the page.
int | $flags | Bitfield of class READ_* constants |
Definition at line 3879 of file Title.php.
References $revQuery, GAID_FOR_UPDATE, getArticleID(), DBAccessObjectUtils\getDBOptions(), Revision\getQueryInfo(), and wfGetDB().
Referenced by getEarliestRevTime().
Title::getFragment | ( | ) |
Get the Title fragment (i.e.
\ the bit after the #) in text form
Use Title::hasFragment to check for a fragment
Implements MediaWiki\Linker\LinkTarget.
Definition at line 1707 of file Title.php.
References $mFragment.
Referenced by WikiPage\insertRedirectEntry().
Title::getFragmentForURL | ( | ) |
Get the fragment in URL form, including the "#" character if there is one.
Definition at line 1726 of file Title.php.
References getInterwikiLookup(), hasFragment(), and isExternal().
Referenced by getCanonicalURL(), getFullURL(), and getLinkURL().
Title::getFullText | ( | ) |
Get the prefixed title with spaces, plus any fragment (part beginning with '#')
Definition at line 1842 of file Title.php.
References $mFragment, getPrefixedText(), and hasFragment().
Referenced by getParentCategories(), WikitextContentHandler\makeRedirectContent(), TitleBlacklistHooks\onMovePageCheckPermissions(), WikitextContent\updateRedirect(), and warnIfPageCannotExist().
Title::getFullURL | ( | $query = '' , |
|
$query2 = false , |
|||
$proto = PROTO_RELATIVE |
|||
) |
Get a real URL referring to this title, with interwiki link and fragment.
string | array | $query | |
string | string[] | bool | $query2 | |
string | int | null | $proto | Protocol type to use in URL |
Definition at line 2068 of file Title.php.
References fixUrlQueryArgs(), getFragmentForURL(), getLocalURL(), Hooks\run(), and wfExpandUrl().
Referenced by getLinkURL(), CssContentHandler\makeRedirectContent(), and JavaScriptContentHandler\makeRedirectContent().
Title::getFullUrlForRedirect | ( | $query = '' , |
|
$proto = PROTO_CURRENT |
|||
) |
Get a url appropriate for making redirects based on an untrusted url arg.
This is basically the same as getFullUrl(), but in the case of external interwikis, we send the user to a landing page, to prevent possible phishing attacks and the like.
array | string | $query | |
string | $proto | Protocol type to use in URL |
Definition at line 2103 of file Title.php.
References getPrefixedDBkey(), SpecialPage\getTitleFor(), and isExternal().
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://
string | array | $query | |
string | bool | $query2 | Deprecated |
Definition at line 2268 of file Title.php.
References $wgInternalServer, $wgServer, fixUrlQueryArgs(), getLocalURL(), PROTO_HTTP, Hooks\run(), and wfExpandUrl().
Referenced by getCdnUrls().
Title::getInterwiki | ( | ) |
Get the interwiki prefix.
Use Title::isExternal to check if a interwiki is set
Implements MediaWiki\Linker\LinkTarget.
Definition at line 923 of file Title.php.
References $mInterwiki.
Referenced by WikiPage\insertRedirectEntry(), WikitextContentHandler\makeRedirectContent(), and warnIfPageCannotExist().
|
staticprivate |
B/C kludge: provide an InterwikiLookup for use by Title.
Ideally, Title would have no methods that need this. Avoid usage of this singleton by using TitleValue and the associated services when possible.
Definition at line 210 of file Title.php.
Referenced by getFragmentForURL(), getLocalURL(), getTransWikiID(), isLocal(), and isTrans().
Title::getLatestRevID | ( | $flags = 0 | ) |
What is the page_latest field for this page?
int | $flags | Either a bitfield of class READ_* constants or GAID_FOR_UPDATE |
Definition at line 3211 of file Title.php.
References $mLatestID, getArticleID(), DBAccessObjectUtils\hasFlags(), and loadFieldFromDB().
Referenced by RefreshLinksJob\getCurrentRevisionIfUnchanged(), and SpecialCiteThisPage\showCitations().
Title::getLength | ( | $flags = 0 | ) |
What is the length of this page? Uses link cache, adding it if necessary.
int | $flags | Either a bitfield of class READ_* constants or GAID_FOR_UPDATE |
Definition at line 3184 of file Title.php.
References $mLength, getArticleID(), DBAccessObjectUtils\hasFlags(), and loadFieldFromDB().
Title::getLinksFrom | ( | $options = [] , |
|
$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 | Query option to Database::select() |
string | $table | Table name |
string | $prefix | Fields prefix |
Definition at line 3402 of file Title.php.
References $res, DB_REPLICA, getArticleID(), WikiPage\getQueryInfo(), makeTitle(), newFromRow(), and wfGetDB().
Referenced by getTemplateLinksFrom().
Title::getLinksTo | ( | $options = [] , |
|
$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 |
Definition at line 3344 of file Title.php.
References $res, DB_MASTER, DB_REPLICA, makeTitle(), and wfGetDB().
Referenced by getTemplateLinksTo().
Title::getLinkURL | ( | $query = '' , |
|
$query2 = false , |
|||
$proto = false |
|||
) |
Get a URL that's the simplest URL that will be valid to link, locally, to the current Title.
It includes the fragment, but does not include the server unless action=render is used (or the link is external). If there's a fragment but the prefixed text is empty, we just return a link to the fragment.
The result obviously should not be URL-escaped, but does need to be HTML-escaped if it's being output in HTML.
string | string[] | $query | |
bool | $query2 | |
string | int | bool | $proto | A PROTO_* constant on how the URL should be expanded, or false (default) for no expansion |
Definition at line 2243 of file Title.php.
References getFragmentForURL(), getFullURL(), getLocalURL(), getPrefixedText(), hasFragment(), and isExternal().
Title::getLocalURL | ( | $query = '' , |
|
$query2 = false |
|||
) |
Get a URL with no fragment or server name (relative URL) from a Title object.
If this page is generated with action=render, however, $wgServer is prepended to make an absolute URL.
string | array | $query | An optional query string, not used for interwiki links. Can be specified as an associative array as well, e.g., [ 'action' => 'edit' ] (keys and values will be URL-escaped). Some query patterns will trigger various shorturl path replacements. |
string | string[] | bool | $query2 | 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. |
Definition at line 2137 of file Title.php.
References $matches, $wgActionPaths, $wgArticlePath, $wgMainPageIsDomainRoot, $wgRequest, $wgScript, $wgServer, $wgVariantArticlePath, equals(), fixUrlQueryArgs(), PathRouter\getActionPaths(), getInterwikiLookup(), getNsText(), getPageLanguage(), getPrefixedDBkey(), isMainPage(), Hooks\run(), wfAppendQuery(), and wfUrlencode().
Referenced by getCanonicalURL(), getEditURL(), getFullURL(), getInternalURL(), and getLinkURL().
Title::getNamespace | ( | ) |
Get the namespace index, i.e.
one of the NS_xxxx constants.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 1037 of file Title.php.
References $mNamespace.
Referenced by SubpageImportTitleFactory\__construct(), JobSpecification\__construct(), Job\__construct(), EmailNotification\actuallyNotifyOnPageChange(), CategoryViewer\addFragmentToTitle(), EmailNotification\canSendUserTalkEmail(), CategoryViewer\doCategoryQuery(), Scribunto_LuaEngine\expandTemplate(), DoubleRedirectJob\fixRedirects(), DoubleRedirectJob\getFinalDestination(), WikiPage\insertRedirectEntry(), LogPager\limitTitle(), PageArchive\listPagesByPrefix(), PageArchive\listPagesBySearch(), WikitextContentHandler\makeRedirectContent(), MediaWiki\Block\Restriction\NamespaceRestriction\matches(), UppercaseTitlesForUnicodeTransition\mungeTitle(), RecentChange\newForCategorization(), EmailNotification\notifyOnPageChange(), MovePageForm\showForm(), and SpecialWhatLinksHere\showIndirectLinks().
Title::getNamespaceKey | ( | $prepend = 'nstab-' | ) |
Generate strings used for xml 'id' names in monobook tabs.
string | $prepend | Defaults to 'nstab-' |
Definition at line 4427 of file Title.php.
References getSubjectNsText().
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 | Bitfield of class READ_* constants |
Definition at line 3869 of file Title.php.
References getRelativeRevisionID().
Title::getNotificationTimestamp | ( | $user = null | ) |
Title::getNsText | ( | ) |
Get the namespace text.
Definition at line 1124 of file Title.php.
References getTitleFormatter(), isExternal(), and wfDebug().
Referenced by getLocalURL(), getSubjectNsText(), getTalkNsText(), and prefix().
Title::getOtherPage | ( | ) |
Get the other title for this page, if this is a subject page get the talk page, if it is a subject page get the talk page.
MWException | If the page doesn't have an other page |
Definition at line 1671 of file Title.php.
References canHaveTalkPage(), getSubjectPage(), getTalkPage(), isSpecialPage(), and isTalkPage().
Title::getPageLanguage | ( | ) |
Get the language in which the content of this page is written in wikitext.
Defaults to content language, but in certain cases it can be e.g. $wgLang (such as special pages, which are in the user language).
Definition at line 4592 of file Title.php.
References $wgLang, $wgLanguageCode, Language\factory(), getDbPageLanguageCode(), ContentHandler\getForTitle(), isSpecialPage(), and wfGetLangObj().
Referenced by getCdnUrls(), and getLocalURL().
Title::getPageViewLanguage | ( | ) |
Get the language in which the content of this page is written when viewed by user.
Defaults to content language, but in certain cases it can be e.g. $wgLang (such as special pages, which are in the user language).
Definition at line 4630 of file Title.php.
References $wgLang, Language\factory(), getDbPageLanguageCode(), ContentHandler\getForTitle(), isSpecialPage(), and wfGetLangObj().
Title::getParentCategories | ( | ) |
Get categories to which this Title belongs and return an array of categories' names.
Definition at line 3757 of file Title.php.
References $dbr, $res, DB_REPLICA, getArticleID(), getFullText(), NS_CATEGORY, and wfGetDB().
Referenced by getParentCategoryTree().
Title::getParentCategoryTree | ( | $children = [] | ) |
Get a tree of parent categories.
array | $children | Array with the children in the keys, to check for circular refs |
Definition at line 3792 of file Title.php.
References getParentCategories(), and newFromText().
Title::getPartialURL | ( | ) |
Title::getPrefixedDBkey | ( | ) |
Get the prefixed database key form.
Definition at line 1806 of file Title.php.
Referenced by PPTemplateFrame_Hash\__construct(), PPTemplateFrame_DOM\__construct(), ScribuntoEngineBase\fetchModuleFromParser(), DoubleRedirectJob\fixRedirects(), DoubleRedirectJob\getFinalDestination(), getFullUrlForRedirect(), getLocalURL(), isValidMoveTarget(), PPFrame_Hash\loopCheck(), PPFrame_DOM\loopCheck(), RecentChange\newForCategorization(), and ScribuntoContent\validate().
Title::getPrefixedText | ( | ) |
Get the prefixed title with spaces.
This is the form usually used for display
Definition at line 1818 of file Title.php.
References $prefixedText, $s, and prefix().
Referenced by __toString(), FileDeleteForm\doDelete(), getFullText(), getLinkURL(), getRestrictionTypes(), CategoryViewer\getSubcategorySortChar(), getTitleValue(), LogPager\limitTitle(), MovePage\moveFile(), CleanupCaps\movePage(), UppercaseTitlesForUnicodeTransition\mungeTitle(), LocalFile\recordUpload2(), SpecialChangeContentModel\setParameter(), SpecialCiteThisPage\showCitations(), MovePageForm\showForm(), SpecialWhatLinksHere\whatlinkshereForm(), and SpecialWhatLinksHere\wlhLink().
Title::getPrefixedURL | ( | ) |
Get a URL-encoded title (not an actual URL) including interwiki.
Definition at line 2011 of file Title.php.
References $s, prefix(), and wfUrlencode().
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 | Bitfield of class READ_* constants |
Definition at line 3857 of file Title.php.
References getRelativeRevisionID().
Title::getRedirectsHere | ( | $ns = null | ) |
Get all extant redirects to this Title.
int | null | $ns | Single namespace to consider; null to consider all namespaces |
Definition at line 4456 of file Title.php.
References $dbr, $mDbkeyform, $mInterwiki, $mNamespace, $res, DB_REPLICA, isExternal(), newFromRow(), and wfGetDB().
|
private |
Get next/previous revision ID relative to another revision ID.
int | $revId | Revision ID. Get the revision that was before this one. |
int | $flags | Bitfield of class READ_* constants |
string | $dir | 'next' or 'prev' |
Definition at line 3835 of file Title.php.
Referenced by getNextRevisionID(), and getPreviousRevisionID().
Title::getRestrictionExpiry | ( | $action | ) |
Get the expiry time for the restriction against a given action.
string | $action |
Definition at line 2784 of file Title.php.
References loadRestrictions().
Title::getRestrictions | ( | $action | ) |
Accessor/initialisation for mRestrictions.
string | $action | Action that permission needs to be checked for |
Definition at line 2756 of file Title.php.
References loadRestrictions().
Referenced by isProtected(), and isSemiProtected().
Title::getRestrictionTypes | ( | ) |
Returns restriction types for the current Title.
Definition at line 2431 of file Title.php.
References exists(), getFilteredRestrictionTypes(), getPrefixedText(), isSpecialPage(), NS_FILE, Hooks\run(), and wfDebug().
Referenced by isProtected(), and loadRestrictionsFromRows().
Title::getRootText | ( | ) |
Get the root page name text without a namespace, i.e.
the leftmost part before any slashes
Definition at line 1865 of file Title.php.
References getText(), and hasSubpages().
Referenced by getRootTitle().
Title::getRootTitle | ( | ) |
Get the root page name title, i.e.
the leftmost part before any slashes
Definition at line 1889 of file Title.php.
References $title, getRootText(), and makeTitleSafe().
Referenced by isRawHtmlMessage().
|
staticprotected |
Returns a list of fields that are to be selected for initializing Title objects or LinkCache entries.
Uses $wgContentHandlerUseDB to determine whether to include page_content_model.
Definition at line 441 of file Title.php.
References $wgContentHandlerUseDB, and $wgPageLanguageUseDB.
Title::getSkinFromConfigSubpage | ( | ) |
Title::getSubjectNsText | ( | ) |
Get the namespace text of the subject (rather than talk) page.
Definition at line 1149 of file Title.php.
References getNsText().
Referenced by getNamespaceKey().
Title::getSubjectPage | ( | ) |
Get a title object associated with the subject page of this talk page.
Definition at line 1614 of file Title.php.
References $title, makeTitle(), and warnIfPageCannotExist().
Referenced by getOtherPage().
Title::getSubpage | ( | $text | ) |
Get the title for a subpage of the current page.
string | $text | The subpage name to add to the title |
Definition at line 1986 of file Title.php.
References 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 |
Definition at line 3046 of file Title.php.
References $dbr, $mNamespace, DB_REPLICA, hasSubpages(), TitleArray\newFromResult(), and wfGetDB().
Referenced by hasSubpages().
Title::getSubpageText | ( | ) |
Get the lowest-level subpage name, i.e.
the rightmost part after any slashes
Definition at line 1962 of file Title.php.
References $mTextform, and hasSubpages().
Referenced by getSubpageUrlForm().
Title::getSubpageUrlForm | ( | ) |
Get a URL-encoded form of the subpage text.
Definition at line 2000 of file Title.php.
References getSubpageText(), and wfUrlencode().
Title::getTalkNsText | ( | ) |
Get the namespace text of the talk page.
Definition at line 1160 of file Title.php.
References getNsText().
Title::getTalkPage | ( | ) |
Get a Title object associated with the talk page of this article.
MWException | if $target doesn't have talk pages, e.g. because it's in NS_SPECIAL or because it's a relative link, or an interwiki link. |
Definition at line 1569 of file Title.php.
References $title, makeTitle(), and warnIfPageCannotExist().
Referenced by getOtherPage(), and getTalkPageIfDefined().
Title::getTalkPageIfDefined | ( | ) |
Get a Title object associated with the talk page of this article, if such a talk page can exist.
Definition at line 1599 of file Title.php.
References canHaveTalkPage(), and getTalkPage().
Title::getTemplateLinksFrom | ( | $options = [] | ) |
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 3456 of file Title.php.
References getLinksFrom().
Title::getTemplateLinksTo | ( | $options = [] | ) |
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 | Query option to Database::select() |
Definition at line 3386 of file Title.php.
References getLinksTo().
Title::getText | ( | ) |
Get the text form (spaces not underscores) of the main part.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 995 of file Title.php.
References $mTextform.
Referenced by EmailNotification\actuallyNotifyOnPageChange(), CategoryViewer\addSubcategoryObject(), EmailNotification\canSendUserTalkEmail(), createFragmentTarget(), getBaseText(), TraditionalImageGallery\getCaptionHtml(), getCategorySortkey(), getDefaultMessageText(), getRootText(), getSubpage(), isConversionTable(), isSubpage(), isWatchable(), PageArchive\listPagesBySearch(), UppercaseTitlesForUnicodeTransition\mungeTitle(), RenameuserHooks\onContributionsToolLinks(), MovePageForm\showForm(), and warnIfPageCannotExist().
|
staticprivate |
Definition at line 427 of file Title.php.
References $titleCache.
Referenced by clearCaches(), and newFromTextThrow().
|
staticprivate |
B/C kludge: provide a TitleParser for use by Title.
Ideally, Title would have no methods that need this. Avoid usage of this singleton by using TitleValue and the associated services when possible.
Definition at line 198 of file Title.php.
Referenced by getNsText().
Title::getTitleProtection | ( | ) |
Is this title subject to title protection? Title protection is the one applied against creation of such title.
Definition at line 2458 of file Title.php.
References getTitleProtectionInternal().
|
protected |
Fetch title protection settings.
To work correctly, $this->loadRestrictions() needs to have access to the actual protections in the database without munging 'sysop' => 'editprotected' and 'autoconfirmed' => 'editsemiprotected'. Other callers probably want $this->getTitleProtection() instead.
Definition at line 2481 of file Title.php.
References $dbr, $mTitleProtection, $res, DB_REPLICA, exists(), CommentStore\getStore(), and wfGetDB().
Referenced by getTitleProtection(), and loadRestrictions().
Title::getTitleValue | ( | ) |
Get a TitleValue object representing this Title.
Definition at line 972 of file Title.php.
References $mTitleValue, getPrefixedText(), and wfDebug().
Title::getTouched | ( | $db = null | ) |
Get the last touched timestamp.
IDatabase | null | $db |
Definition at line 4375 of file Title.php.
References DB_REPLICA, pageCond(), and wfGetDB().
Title::getTransWikiID | ( | ) |
Returns the DB name of the distant wiki which owns the object.
Definition at line 955 of file Title.php.
References getInterwikiLookup(), and isExternal().
Title::getUserCaseDBKey | ( | ) |
Get the DB key with the initial letter case as specified by the user.
Definition at line 1023 of file Title.php.
References $mDbkeyform, and $mUserCaseDBKey.
Title::getUserPermissionsErrors | ( | $action, | |
$user, | |||
$rigor = PermissionManager::RIGOR_SECURE , |
|||
$ignoreErrors = [] |
|||
) |
Can $user perform $action on this page?
string | $action | Action that permission needs to be checked for |
User | $user | User to check |
string | $rigor | One of (quick,full,secure)
|
array | $ignoreErrors | Array of Strings Set this to a list of message keys whose corresponding errors may be ignored. |
Exception |
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 1082 of file Title.php.
References getContentModel().
Referenced by Scribunto_LuaSandboxEngine\formatLimitData(), isSiteCssConfigPage(), isSiteJsConfigPage(), isSiteJsonConfigPage(), isUserCssConfigPage(), isUserJsConfigPage(), isUserJsonConfigPage(), isWikitextPage(), and Scribunto_LuaEngine\loadPackage().
Title::hasFragment | ( | ) |
Check if a Title fragment is set.
Implements MediaWiki\Linker\LinkTarget.
Definition at line 1717 of file Title.php.
Referenced by getFragmentForURL(), getFullText(), and getLinkURL().
Title::hasSourceText | ( | ) |
Does this page have source text?
Definition at line 4227 of file Title.php.
References exists(), NS_MEDIAWIKI, 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.
int | $ns |
Title::hasSubpages | ( | ) |
Does this have subpages? (Warning, usually requires an extra DB query.)
Definition at line 3015 of file Title.php.
References $mHasSubpages, and getSubpages().
Referenced by getBaseText(), getEditNotices(), getRootText(), getSubpages(), getSubpageText(), and isSubpage().
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 |
Implements MediaWiki\Linker\LinkTarget.
Definition at line 1261 of file Title.php.
References equals().
Referenced by inNamespaces(), and isRawHtmlMessage().
Title::inNamespaces | ( | $namespaces | ) |
Returns true if the title is inside one of the specified namespaces.
int|int[] | ...$namespaces The namespaces to check for |
Definition at line 1273 of file Title.php.
References inNamespace().
Title::invalidateCache | ( | $purgeTime = null | ) |
Updates page_touched for this page; called from LinksUpdate.php.
string | null | $purgeTime | [optional] TS_MW timestamp |
Definition at line 4308 of file Title.php.
References Wikimedia\Rdbms\IDatabase\addQuotes(), DeferredUpdates\addUpdate(), DB_MASTER, ResourceLoaderWikiModule\invalidateModuleCache(), pageCond(), DeferredUpdates\PRESEND, Wikimedia\Rdbms\IDatabase\timestamp(), Wikimedia\Rdbms\IDatabase\update(), wfGetDB(), and wfReadOnly().
Referenced by File\purgeDescription().
Title::isAlwaysKnown | ( | ) |
Should links to this title be shown as potentially viewable (i.e.
as "bluelinks"), even if there's no record by this title in the page table?
This function is semi-deprecated for public use, as well as somewhat misleadingly named. You probably just want to call isKnown(), which calls this function internally.
(ISSUE: Most of these checks are cheap, but the file existence check can potentially be quite expensive. Including it here fixes a lot of existing code, but we might want to add an optional parameter to skip it and any other expensive checks.)
Definition at line 4164 of file Title.php.
References hasSourceText(), isExternal(), NS_FILE, NS_MAIN, NS_MEDIA, NS_MEDIAWIKI, NS_SPECIAL, and Hooks\run().
Referenced by isKnown().
Title::isBigDeletion | ( | ) |
Check whether the number of revisions of this page surpasses $wgDeleteRevisionsLimit.
Definition at line 3931 of file Title.php.
References $dbr, $mIsBigDeletion, $wgDeleteRevisionsLimit, DB_REPLICA, getArticleID(), and wfGetDB().
Title::isCascadeProtected | ( | ) |
Cascading protection: Return true if cascading restrictions apply to this page, false if not.
Definition at line 2626 of file Title.php.
References getCascadeProtectionSources().
Title::isContentPage | ( | ) |
Title::isConversionTable | ( | ) |
Is this a conversion table for the LanguageConverter?
Definition at line 1368 of file Title.php.
References getText(), and NS_MEDIAWIKI.
Title::isDeleted | ( | ) |
Title::isDeletedQuick | ( | ) |
Is there a version of this page in the deletion archive?
Definition at line 3101 of file Title.php.
References $dbr, DB_REPLICA, NS_FILE, and wfGetDB().
Referenced by File\wasDeleted().
Title::isExternal | ( | ) |
Is this Title interwiki?
Implements MediaWiki\Linker\LinkTarget.
Definition at line 912 of file Title.php.
Referenced by getEditURL(), DoubleRedirectJob\getFinalDestination(), getFragmentForURL(), getFullUrlForRedirect(), getLinkURL(), getNsText(), getRedirectsHere(), getTransWikiID(), isAlwaysKnown(), isLocal(), isMovable(), isTrans(), isWatchable(), prefix(), and secureAndSplit().
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.
Definition at line 4218 of file Title.php.
References exists(), and isAlwaysKnown().
Title::isLocal | ( | ) |
Determine whether the object refers to a page within this project (either this wiki or a wiki with a local interwiki, see https://www.mediawiki.org/wiki/Manual:Interwiki_table#iw_local )
Definition at line 897 of file Title.php.
References getInterwikiLookup(), and isExternal().
Title::isMainPage | ( | ) |
Is this the mainpage?
Definition at line 1347 of file Title.php.
References equals().
Referenced by getLocalURL().
Title::isMovable | ( | ) |
Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable.
Definition at line 1323 of file Title.php.
References isExternal(), and Hooks\run().
Title::isNamespaceProtected | ( | User | $user | ) |
Determines if $user is unable to edit this page because it has been protected by $wgNamespaceProtection.
Definition at line 2607 of file Title.php.
References $wgNamespaceProtection.
Title::isNewPage | ( | ) |
Check if this is a new page.
Definition at line 3921 of file Title.php.
References $dbr, DB_REPLICA, pageCond(), and wfGetDB().
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. |
Definition at line 2574 of file Title.php.
References $type, $wgRestrictionLevels, getRestrictions(), getRestrictionTypes(), and isSpecialPage().
Title::isRawHtmlMessage | ( | ) |
Is this a message which can contain raw HTML?
Definition at line 1538 of file Title.php.
References $wgRawHtmlMessages, getDBkey(), getRootTitle(), inNamespace(), and NS_MEDIAWIKI.
Title::isRedirect | ( | $flags = 0 | ) |
Is this an article that is a redirect page? Uses link cache, adding it if necessary.
int | $flags | Either a bitfield of class READ_* constants or GAID_FOR_UPDATE |
Definition at line 3155 of file Title.php.
References $mRedirect, getArticleID(), DBAccessObjectUtils\hasFlags(), and loadFieldFromDB().
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) |
Definition at line 2546 of file Title.php.
References $wgSemiprotectedRestrictionLevels, and getRestrictions().
Title::isSingleRevRedirect | ( | ) |
Locks the page row and check if this page is single revision redirect.
This updates the cached fields of this instance via Title::loadFromRow()
Definition at line 3655 of file Title.php.
References $wgContentHandlerUseDB, DB_MASTER, pageCond(), and wfGetDB().
Title::isSiteConfigPage | ( | ) |
Could this MediaWiki namespace page contain custom CSS, JSON, or JavaScript for the global UI.
This is generally true for pages in the MediaWiki namespace having CONTENT_MODEL_CSS, CONTENT_MODEL_JSON, or CONTENT_MODEL_JAVASCRIPT.
This method does not return true for per-user JS/JSON/CSS. Use isUserConfigPage() for that!
Note that this method should not return true for pages that contain and show "inactive" CSS, JSON, or JS.
Definition at line 1398 of file Title.php.
References isSiteCssConfigPage(), isSiteJsConfigPage(), and isSiteJsonConfigPage().
Title::isSiteCssConfigPage | ( | ) |
Is this a sitewide CSS "config" page?
Definition at line 1484 of file Title.php.
References CONTENT_MODEL_CSS, hasContentModel(), and NS_MEDIAWIKI.
Referenced by isSiteConfigPage().
Title::isSiteJsConfigPage | ( | ) |
Is this a sitewide JS "config" page?
Definition at line 1520 of file Title.php.
References CONTENT_MODEL_JAVASCRIPT, hasContentModel(), and NS_MEDIAWIKI.
Referenced by isSiteConfigPage().
Title::isSiteJsonConfigPage | ( | ) |
Is this a sitewide JSON "config" page?
Definition at line 1502 of file Title.php.
References CONTENT_MODEL_JSON, hasContentModel(), and NS_MEDIAWIKI.
Referenced by isSiteConfigPage().
Title::isSpecial | ( | $name | ) |
Returns true if this title resolves to the named special page.
string | $name | The special page name |
Definition at line 1219 of file Title.php.
References isSpecialPage().
Referenced by isValidRedirectTarget().
Title::isSpecialPage | ( | ) |
Returns true if this is a special page.
Definition at line 1209 of file Title.php.
References NS_SPECIAL.
Referenced by SkinTemplate\buildPersonalUrls(), fixSpecialName(), getOtherPage(), getPageLanguage(), getPageViewLanguage(), getRestrictionTypes(), isProtected(), isSpecial(), isValidRedirectTarget(), and secureAndSplit().
Title::isSubpage | ( | ) |
Is this a subpage?
Definition at line 1356 of file Title.php.
References getText(), and hasSubpages().
Referenced by isUserCssConfigPage(), isUserJsConfigPage(), and isUserJsonConfigPage().
Title::isSubpageOf | ( | Title | $title | ) |
Title::isTalkPage | ( | ) |
Is this a talk page of some sort?
Definition at line 1553 of file Title.php.
Referenced by getOtherPage().
Title::isTrans | ( | ) |
Determine whether the object refers to a page within this project and is transcludable.
Definition at line 942 of file Title.php.
References getInterwikiLookup(), and isExternal().
Title::isUserConfigPage | ( | ) |
Is this a "config" (.css, .json, or .js) sub-page of a user page?
Definition at line 1412 of file Title.php.
References isUserCssConfigPage(), isUserJsConfigPage(), and isUserJsonConfigPage().
Title::isUserCssConfigPage | ( | ) |
Is this a CSS "config" sub-page of a user page?
Definition at line 1442 of file Title.php.
References CONTENT_MODEL_CSS, hasContentModel(), isSubpage(), and NS_USER.
Referenced by getCdnUrls(), and isUserConfigPage().
Title::isUserJsConfigPage | ( | ) |
Is this a JS "config" sub-page of a user page?
Definition at line 1470 of file Title.php.
References CONTENT_MODEL_JAVASCRIPT, hasContentModel(), isSubpage(), and NS_USER.
Referenced by getCdnUrls(), and isUserConfigPage().
Title::isUserJsonConfigPage | ( | ) |
Is this a JSON "config" sub-page of a user page?
Definition at line 1456 of file Title.php.
References CONTENT_MODEL_JSON, hasContentModel(), isSubpage(), and NS_USER.
Referenced by getCdnUrls(), and isUserConfigPage().
Title::isValid | ( | ) |
Returns true if the title is valid, false if it is invalid.
Valid titles can be round-tripped via makeTitle() and newFromText(). Their DB key can be used in the database, though it may not have the correct capitalization.
Invalid titles may get returned from makeTitle(), and it may be useful to allow them to exist, e.g. in order to process log entries about pages in namespaces that belong to extensions that are no longer installed.
Definition at line 863 of file Title.php.
Referenced by UppercaseTitlesForUnicodeTransition\mungeTitle().
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
Title | &$nt | The new title |
bool | $auth | Whether to check user permissions (uses $wgUser) |
string | $reason | Is the log summary of the move, used for spam checking |
Definition at line 3551 of file Title.php.
References wfDeprecated(), and wfMergeErrorArrays().
Title::isValidMoveTarget | ( | $nt | ) |
Checks if $this can be moved to a given Title.
Selects for update, so don't call it unless you mean business
Title | $nt | The new title to check |
Definition at line 3706 of file Title.php.
References $content, $file, getPrefixedDBkey(), Revision\newFromTitle(), NS_FILE, wfDebug(), and wfDeprecated().
Title::isValidRedirectTarget | ( | ) |
Check if this Title is a valid redirect target.
Definition at line 4492 of file Title.php.
References $wgInvalidRedirectTargets, isSpecial(), and isSpecialPage().
Referenced by AbstractContent\getRedirectChain(), and XmlDumpWriter\openPage().
Title::isWatchable | ( | ) |
Can this title be added to a user's watchlist?
False for relative section links (with getText() === ''), interwiki links (with getInterwiki() !== ''), and pages in NS_SPECIAL.
Definition at line 1198 of file Title.php.
References getText(), and isExternal().
Title::isWikitextPage | ( | ) |
Does that page contain wikitext, or it is JS, CSS or whatever?
Definition at line 1380 of file Title.php.
References CONTENT_MODEL_WIKITEXT, and hasContentModel().
|
private |
If the content model field is not frozen then update it with a retreived value.
string | bool | $model | CONTENT_MODEL_XXX constant or false |
Definition at line 1113 of file Title.php.
Referenced by getContentModel(), and loadFromRow().
|
static |
Get a regex character class describing the legal characters in a link.
Definition at line 695 of file Title.php.
References $wgLegalTitleChars.
Referenced by CleanupImages\buildSafeTitle(), ResourceLoaderStartUpModule\getConfigSettings(), MediaWikiTitleCodec\getTitleInvalidRegex(), and wfStripIllegalFilenameChars().
|
private |
int | $flags | Bitfield of class READ_* constants |
Definition at line 4748 of file Title.php.
References GAID_FOR_UPDATE, DBAccessObjectUtils\getDBOptions(), pageCond(), and wfGetDB().
Referenced by getArticleID(), getContentModel(), getLatestRevID(), getLength(), and isRedirect().
Title::loadFromRow | ( | $row | ) |
Load Title object fields from a DB row.
If false is given, the title will be treated as non-existing.
stdClass | bool | $row | Database row |
Definition at line 530 of file Title.php.
References lazyFillContentModel().
Title::loadRestrictions | ( | $oldFashionedRestrictions = null , |
|
$flags = 0 |
|||
) |
Load restrictions from the page_restrictions table.
string | null | $oldFashionedRestrictions | Comma-separated set of permission keys indicating who can move or edit the page from the page table, (pre 1.10) rows. Edit and move sections are separated by a colon Example: "edit=autoconfirmed,sysop:move=sysop" |
int | $flags | A bit field. If self::READ_LATEST is set, skip replicas and read from the master DB. |
Definition at line 2893 of file Title.php.
References $cache, $dbr, DB_MASTER, DB_REPLICA, getArticleID(), getTitleProtectionInternal(), DBAccessObjectUtils\hasFlags(), loadRestrictionsFromRows(), wfGetDB(), and wfTimestampNow().
Referenced by areRestrictionsCascading(), getAllRestrictions(), getRestrictionExpiry(), and getRestrictions().
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 | Array of db result objects |
string | null | $oldFashionedRestrictions | Comma-separated set of permission keys indicating who can move or edit the page from the page table, (pre 1.10) rows. Edit and move sections are separated by a colon Example: "edit=autoconfirmed,sysop:move=sysop" |
Definition at line 2815 of file Title.php.
References $dbr, $type, DB_REPLICA, getRestrictionTypes(), wfGetDB(), and wfTimestampNow().
Referenced by loadRestrictions().
|
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 |
bool | $canonicalNamespace | If true, use the canonical name for $ns instead of the localized version. |
Definition at line 814 of file Title.php.
References $title.
Referenced by SpecialRedirect\dispatchFile(), MovePageForm\doSubmit(), SpecialExport\getPagesFromCategory(), SpecialExport\getPagesFromNamespace(), makeTitleSafe(), nameOf(), TitleCleanup\processRow(), and HTMLTitleTextField\validate().
|
static |
Create a new Title from a namespace index and a DB key.
It's assumed that $ns and $title are safe, for instance when they came directly from the database or a special page name, not from user input.
No validation is applied. For convenience, spaces are normalized to underscores, so that e.g. 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 586 of file Title.php.
References $t, $title, and wfUrlencode().
Referenced by DeletePageJob\__construct(), Scribunto_LuaDataProvider\__construct(), JobSpecification\__construct(), Job\__construct(), CategoryViewer\addFragmentToTitle(), ChangesFeed\buildItems(), FindOrphanedFiles\checkFiles(), LocalRepo\checkRedirect(), RenameUserCleanup\checkRenameLog(), Orphans\checkSeparation(), CompressOld\compressWithConcat(), BenchmarkTitleValue\constructTitle(), ApiFeedWatchlist\createFeedItem(), createFragmentTarget(), SpecialRedirect\dispatchUser(), UppercaseTitlesForUnicodeTransition\doMove(), UppercaseTitlesForUnicodeTransition\doUpdate(), LinkHolderArray\doVariants(), SpecialRenameuser\execute(), CheckBadRedirects\execute(), ApiQueryDeletedrevs\execute(), ApiQueryFilearchive\execute(), DeleteDefaultMessages\execute(), FixDoubleRedirects\execute(), AttachLatest\execute(), DumpLinks\execute(), ApiComparePages\execute(), PurgeChangedPages\execute(), NukeNS\execute(), DeleteEqualMessages\execute(), SqlSearchResultSet\extractResults(), ApiQueryLogEvents\extractRowInfo(), ApiQueryUserContribs\extractRowInfo(), ApiQueryRecentChanges\extractRowInfo(), Job\factory(), ApiFeedContributions\feedItem(), SpecialNewpages\feedItem(), MediaWikiGadgetsDefinitionRepo\fetchStructuredList(), SpecialRecentChanges\filterByCategories(), ForeignAPIRepo\findBySha1(), DoubleRedirectJob\fixRedirects(), fixSpecialName(), WikiFilePage\followRedirect(), MediaWiki\Widget\Search\InterwikiSearchResultSetWidget\footerHtml(), ApiParse\formatCategoryLinks(), FeedUtils\formatDiff(), ApiParse\formatLinks(), SpecialUnusedTemplates\formatResult(), SpecialUnusedCategories\formatResult(), SpecialUncategorizedCategories\formatResult(), SpecialListDuplicatedFiles\formatResult(), SpecialAncientPages\formatResult(), SpecialWantedCategories\formatResult(), SpecialBrokenRedirects\formatResult(), SpecialDoubleRedirects\formatResult(), SpecialListRedirects\formatResult(), SpecialMIMESearch\formatResult(), DeletedContribsPager\formatRevisionRow(), NewFilesPager\formatRow(), SpecialNewpages\formatRow(), AllMessagesTablePager\formatValue(), ImageListPager\formatValue(), SearchSuggestion\fromText(), LinksUpdate\getAddedLinks(), getBrokenLinksFrom(), User\getCanonicalName(), getCascadeProtectionSources(), ApiUpload\getChunkResult(), PopulateContentTables\getContentModel(), ApiComparePages\getDiffRevision(), ApiErrorFormatter\getDummyTitle(), CategoriesRdf\getDumpURI(), DoubleRedirectJob\getFinalDestination(), WikiPage\getHiddenCategories(), ChangeTagsLogItem\getHTML(), RevDelLogItem\getHTML(), SpecialExport\getLinks(), getLinksFrom(), getLinksTo(), SearchNearMatcher\getNearMatchInternal(), SpecialNuke\getNewPages(), MediaWiki\Search\ParserOutputSearchDataExtractor\getOutgoingLinks(), NewUsersLogFormatter\getPreloadTitles(), ApiQueryInfo\getProtectionInfo(), SpecialRandomInCategory\getRandomTitle(), SpecialMypage\getRedirect(), SpecialMytalk\getRedirect(), File\getRedirectedTitle(), WikiFilePage\getRedirectTarget(), SpecialListRedirects\getRedirectTarget(), WikiPage\getRedirectTarget(), ApiPageSet\getRedirectTargets(), LinksUpdate\getRemovedLinks(), RollbackEdits\getRollbackTitles(), ScribuntoHooks\getSoftwareInfo(), getSubjectPage(), getTalkPage(), RCDatabaseLogEntry\getTarget(), DatabaseLogEntry\getTarget(), MediaWiki\Search\ParserOutputSearchDataExtractor\getTemplates(), EditPage\getTemplates(), RecentChange\getTitle(), DifferenceEngine\getTitle(), User\getTokenUrl(), Scribunto_LuaUriLibrary\getUrl(), ExternalUserNames\getUserLinkTitle(), UserRightsProxy\getUserPage(), User\getUserPage(), FixDefaultJsonContentPages\handleRow(), MediaWiki\Widget\Search\SimpleSearchResultSetWidget\headerHtml(), ImagePage\imageLinks(), ApiPageSet\initFromQueryResult(), ApiPageSet\initFromRevIDs(), CategoriesRdf\labelToUrl(), MessageCache\loadCachedMessagePageEntry(), MediaWiki\Rest\EntryPoint\main(), MediaWiki\main(), NamespaceDupes\mergePage(), UppercaseTitlesForUnicodeTransition\mungeTitle(), Revision\newFromArchiveRow(), JobSpecification\newFromArray(), newFromLinkTarget(), OldLocalFile\newFromRow(), LocalFile\newFromRow(), ArchivedFile\newFromRow(), newFromRow(), Article\newFromTitle(), Revision\RevisionStore\newRevisionFromArchiveRow(), CategoryMembershipChangeJob\notifyUpdatesForRevision(), ConfirmEditHooks\onAlternateEditPreview(), RenameuserHooks\onShowMissingArticle(), PageImages\onSpecialMobileEditWatchlistImages(), InfoAction\pageInfo(), MessageCache\parse(), MediaWiki\parseTitle(), ApiUpload\performUpload(), PopulateContentModel\populateRevisionOrArchive(), RebuildTextIndex\populateSearchIndex(), SpecialBlock\processForm(), CleanupWatchlist\processRow(), CleanupCaps\processRowToLowercase(), CleanupCaps\processRowToUppercase(), SpecialUnblock\processUnblock(), PurgeChangedFiles\purgeFromLogType(), PurgeList\purgeNamespace(), MessageCache\refreshAndReplaceInternal(), RenameuserSQL\rename(), CategoryTree\renderChildren(), CategoryTree\renderParents(), LinkHolderArray\replaceInternal(), ApiQueryDeletedRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryImages\run(), ApiQueryProtectedTitles\run(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), ApiQueryExtLinksUsage\run(), ApiQueryCategories\run(), ApiQueryWatchlistRaw\run(), ApiQueryAllCategories\run(), ApiQueryPagesWithProp\run(), ApiQueryCategoryMembers\run(), ApiQueryAllPages\run(), ApiQueryLinks\run(), ApiQueryAllImages\run(), ApiQueryQueryPage\run(), ApiQueryBacklinksprop\run(), ApiQueryAllLinks\run(), DoubleRedirectJob\run(), ApiQueryRecentChanges\run(), ApiQueryBacklinks\runFirstQuery(), ApiQueryRandom\runQuery(), ApiOpenSearch\search(), SearchSuggestion\setText(), Scribunto_LuaTitleLibraryTest\setUp(), SpecialAllPages\showChunk(), SpecialWhatLinksHere\showIndirectLinks(), SpecialUpload\showUploadWarning(), templateCallback(), Scribunto_LuaCommonTest\testBug62291(), Scribunto_LuaCommonTest\testCallParserFunction(), Scribunto_LuaLanguageLibraryTest\testFormatDateTTLs(), Scribunto_LuaCommonTest\testFrames(), Scribunto_LuaCommonTest\testLoadDataLoadedOnce(), Scribunto_LuaCommonTest\testModuleStringExtend(), Scribunto_LuaCommonTest\testOsDateTimeTTLs(), Scribunto_LuaCommonTest\testPHPLibrary(), CoreParserFunctions\urlFunction(), CategoriesRdf\writeCategoryData(), CategoriesRdf\writeCategoryLinkData(), and XmlDumpWriter\writeLogItem().
|
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.
Title objects returned by makeTitleSafe() are guaranteed to be valid, that is, they return true from the isValid() method. If no valid Title can be constructed from the input, this method returns null.
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 613 of file Title.php.
References $t, $title, exists(), and makeName().
Referenced by ImageListPager\__construct(), ActiveUsersPager\__construct(), UsersPager\__construct(), AllMessagesTablePager\__construct(), ParserOutput\addTrackingCategory(), CleanupImages\buildSafeTitle(), BenchmarkTitleValue\constructTitleSafe(), NaiveImportTitleFactory\createTitleFromForeignTitle(), NamespaceImportTitleFactory\createTitleFromForeignTitle(), PrefixSearch\defaultSearchBackend(), DifferenceEngine\deletedLink(), SpecialReplaceText\doSpecialReplaceText(), MovePageForm\doSubmit(), LinkHolderArray\doVariants(), Revision\ensureTitle(), SpecialRenameuser\execute(), SpecialLog\execute(), SpecialContributions\execute(), MakeTestEdits\execute(), SpecialExport\execute(), ImportSiteScripts\execute(), RefreshLinks\execute(), RebuildFileCache\execute(), MovePageForm\execute(), ImportImages\execute(), ApiQueryInfo\execute(), GadgetDefinitionContent\fillParserOutput(), SpecialNewpages\form(), Linker\formatLinksInComment(), PageQueryPage\formatResult(), WantedQueryPage\formatResult(), SpecialFewestRevisions\formatResult(), SpecialMostLinkedCategories\formatResult(), SpecialMostCategories\formatResult(), SpecialMostInterwikis\formatResult(), SpecialMostLinkedTemplates\formatResult(), SpecialMostLinked\formatResult(), SpecialUnwatchedPages\formatResult(), SpecialShortPages\formatResult(), SpecialProtectedtitles\formatRow(), ProtectedPagesPager\formatValue(), ImageListPager\formatValue(), MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), NamespaceDupes\getAlternateTitle(), getBaseTitle(), LinksUpdate\getCategoryInsertions(), NamespaceDupes\getDestinationTitle(), SpecialUncategorizedCategories\getExceptionList(), GadgetDefinitionNamespaceRepo\getGadget(), RenameuserLogFormatter\getMessageParameters(), SpecialAllPages\getNamespaceKeyAndText(), SpecialEditWatchlist\getNormalForm(), WantedFilesPage\getPageHeader(), RenameuserLogFormatter\getPreloadTitles(), NewPagesPager\getQueryInfo(), RandomPage\getRandomTitle(), ReplaceTextSearch\getReplacedTitle(), getRootTitle(), SpecialPage\getSafeTitleFor(), MergeHistoryPager\getStartBody(), LogPager\getStartBody(), getSubpage(), SpecialBlock\getTargetUserTitle(), Category\getTitle(), SpecialReplaceText\getTitlesForEditingWithContext(), SpecialReplaceText\getTitlesForMoveAndUnmoveableTitles(), TrackingCategories\getTrackingCategories(), SpecialUpload\getUploadForm(), PageImages\Hooks\LinksUpdateHookHandler\getUrlBlacklist(), SpecialUpload\getWatchCheck(), SpecialEditWatchlist\getWatchlist(), User\idFromName(), ScribuntoHooks\invokeHook(), Scribunto\isDocPage(), ChangeTags\isTagNameValid(), LogPager\limitPerformer(), ArchivedFile\loadFromRow(), Skin\makeNSUrl(), Linker\makeThumbLink2(), Scribunto_LuaTitleLibrary\makeTitle(), TitleCleanup\moveInconsistentPage(), MovePage\moveSubpagesInternal(), Category\newFromName(), File\normalizeTitle(), SpecialRandomInCategory\onSubmit(), ImageQueryPage\outputResults(), Scribunto_LuaSiteLibrary\pagesInCategory(), CoreParserFunctions\pagesincategory(), CategoryTreePage\prefixSearchSubpages(), CleanupImages\processRow(), RefreshLinksJob\run(), CategoryFinder\seed(), RevisionDeleteUser\setUsernameBitfields(), SpecialUndelete\showHistory(), SpecialBookSources\showList(), SpecialUndelete\showList(), SpecialGadgets\showMainForm(), SpecialAllPages\showToplevel(), SpecialUpload\showViewDeletedLinks(), MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences(), CoreParserFunctions\special(), PrefixSearch\specialSearch(), TitleBlacklistHooks\testUserName(), ApiQueryBase\titlePartToKey(), ApiFileRevert\validateParameters(), and wfStreamThumb().
Title::moveSubpages | ( | $nt, | |
$auth = true , |
|||
$reason = '' , |
|||
$createRedirect = true , |
|||
array | $changeTags = [] |
||
) |
Move this page's subpages to be subpages of $nt.
Title | $nt | 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 |
array | $changeTags | Applied to the entry in the move log and redirect page revision |
Definition at line 3620 of file Title.php.
References $status, and wfDeprecated().
Move a title to a new location.
Title | &$nt | 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. |
array | $changeTags | Applied to the entry in the move log and redirect page revision |
Definition at line 3587 of file Title.php.
References $status, and wfDeprecated().
|
static |
Get the prefixed DB key associated with an ID.
int | $id | The page_id of the article |
Definition at line 674 of file Title.php.
References $dbr, $s, DB_REPLICA, makeName(), and wfGetDB().
|
static |
|
static |
Create a new Title from an article ID.
int | $id | The page_id corresponding to the Title to create |
int | $flags | Bitfield of class READ_* constants |
Definition at line 467 of file Title.php.
References $title, GAID_FOR_UPDATE, DBAccessObjectUtils\getDBOptions(), newFromRow(), and wfGetDB().
Referenced by RCCacheEntryFactory\buildDiffLink(), CleanupSpam\cleanupArticle(), ApiFeedWatchlist\createFeedItem(), SpecialReplaceText\createJobsForTextReplacements(), RecompressTracked\doPage(), ApiMergeHistory\execute(), ApiMove\execute(), EnhancedChangesList\getDiffHistLinks(), ApiComparePages\getDiffRevision(), ApiRollback\getRbTitle(), MediaWiki\Block\Restriction\PageRestriction\getTitle(), Revision\RevisionStore\getTitle(), ApiBase\getTitleFromTitleOrPageId(), ApiComparePages\guessTitle(), SpecialMergeHistory\merge(), Article\newFromID(), Revision\newKnownCurrent(), Revision\newNullRevision(), Scribunto_LuaTitleLibrary\newTitle(), and MediaWiki\parseTitle().
|
static |
Make an array of titles from an array of IDs.
int[] | $ids | Array of IDs |
Definition at line 492 of file Title.php.
References $dbr, $res, DB_REPLICA, newFromRow(), and wfGetDB().
Referenced by Revision\RevisionStore\newRevisionsFromBatch().
|
static |
Returns a Title given a LinkTarget.
If the given LinkTarget is already a Title instance, that instance is returned, unless $forceClone is "clone". If $forceClone is "clone" and the given LinkTarget is already a Title instance, that instance is copied using the clone operator.
LinkTarget | $linkTarget | Assumed to be safe. |
string | $forceClone | set to NEW_CLONE to ensure a fresh instance is returned. |
Definition at line 268 of file Title.php.
References MediaWiki\Linker\LinkTarget\getFragment(), MediaWiki\Linker\LinkTarget\getInterwiki(), MediaWiki\Linker\LinkTarget\getNamespace(), MediaWiki\Linker\LinkTarget\getText(), and makeTitle().
Referenced by ActivityUpdateJob\__construct(), MediaWiki\Linker\LinkRenderer\buildAElement(), castFromLinkTarget(), MediaWiki\Permissions\PermissionManager\checkActionPermissions(), MediaWiki\Permissions\PermissionManager\checkCascadingSourcesRestrictions(), MediaWiki\Permissions\PermissionManager\checkPageRestrictions(), MediaWiki\Permissions\PermissionManager\checkPermissionHooks(), MediaWiki\Permissions\PermissionManager\checkQuickPermissions(), MediaWiki\Permissions\PermissionManager\checkReadPermissions(), MediaWiki\Permissions\PermissionManager\checkSiteConfigPermissions(), MediaWiki\Permissions\PermissionManager\checkSpecialsAndNSPermissions(), MediaWiki\Permissions\PermissionManager\checkUserBlock(), MediaWiki\Permissions\PermissionManager\checkUserConfigPermissions(), ApiExpandTemplates\execute(), ApiComparePages\execute(), ApiQueryRevisionsBase\extractDeprecatedContent(), ApiQueryWatchlist\extractOutputData(), ApiQueryRevisionsBase\extractRevisionInfo(), TemplatesOnThisPageFormatter\formatTemplate(), Revision\MainSlotRoleHandler\getDefaultModel(), ApiComparePages\getDiffRevision(), WANCacheReapUpdate\getEventAffectedKeys(), Linker\getImageLinkMTOParams(), MediaWiki\Linker\LinkRenderer\getLinkURL(), Revision\RevisionRenderer\getRenderedRevision(), Revision\RevisionStore\getRevisionByTitle(), Revision\getTitle(), ApiComparePages\guessTitle(), Revision\RevisionStore\insertRevisionOn(), Revision\MainSlotRoleHandler\isAllowedModel(), MediaWiki\Permissions\PermissionManager\isBlockedFrom(), Linker\makeImageLink(), MediaWiki\Linker\LinkRenderer\makeLink(), Linker\makeSelfLinkObj(), Linker\makeThumbLink2(), Revision\MutableRevisionRecord\newFromParentRevision(), newFromTitleValue(), ApiQueryAllRevisions\run(), ApiQueryAllDeletedRevisions\run(), ApiQueryRevisions\run(), MediaWiki\Linker\LinkRenderer\runLegacyBeginHook(), DifferenceEngine\setRevisions(), ManualLogEntry\setTarget(), and ApiComparePages\setVals().
|
static |
Make a Title object from a DB row.
stdClass | $row | Object database row (needs at least page_title,page_namespace) |
Definition at line 518 of file Title.php.
References $t, and makeTitle().
Referenced by CategoryViewer\doCategoryQuery(), CompareParserCache\execute(), UpdateCollation\execute(), SpecialPagesWithProp\formatResult(), SpecialNewpages\formatRow(), ContribsPager\formatRow(), AllMessagesTablePager\getCustomisedStatuses(), getLinksFrom(), getRedirectsHere(), Revision\RevisionStore\getTitle(), newFromID(), newFromIDs(), MediaWiki\Block\Restriction\PageRestriction\newFromRow(), WikiPage\newFromRow(), Revision\RevisionStore\newRevisionsFromBatch(), XmlDumpWriter\openPage(), PopulateContentModel\populatePage(), PopulateContentModel\populateRevisionOrArchive(), ApiPageSet\processDbRow(), CategoryTree\renderChildren(), ApiQueryLangBacklinks\run(), ApiQueryIWBacklinks\run(), TitleArrayFromResult\setCurrent(), SpecialAllPages\showChunk(), and SpecialPrefixindex\showPrefixChunk().
|
static |
Create a new Title from text, such as what one would find in a link.
De- codes any HTML entities in the text.
Title objects returned by this method are guaranteed to be valid, and thus return true from the isValid() method.
string | int | null | $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(). |
InvalidArgumentException |
Definition at line 316 of file Title.php.
References newFromTextThrow().
Referenced by DoubleRedirectJob\__construct(), ImageListPager\__construct(), ScribuntoException\__construct(), Installer\__construct(), LinkHolderArray\__wakeup(), Skin\addToSidebarPlain(), CoreParserFunctions\basepagename(), CoreParserFunctions\basepagenamee(), SkinTemplate\buildPersonalUrls(), ImageListPager\buildQueryConds(), Scribunto_LuaTitleLibrary\cascadingProtection(), CoreParserFunctions\cascadingsources(), ReplaceTextSearch\categoryCondition(), SpecialComparePages\checkExistingTitle(), LocalRepo\checkRedirect(), Skin\checkTitle(), ApiFeedWatchlist\createFeedItem(), SubpageImportTitleFactory\createTitleFromForeignTitle(), CoreParserFunctions\displaytitle(), SpecialNuke\doDelete(), SpecialExport\doExport(), SpecialRecentChangesLinked\doMainQuery(), PurgeList\doPurge(), GenderCache\doTitlesArray(), Skin\drawCategoryBrowser(), ApiScribuntoConsole\execute(), ApiUndelete\execute(), ApiMergeHistory\execute(), ApiWatch\execute(), ApiMove\execute(), ApiRevisionDelete\execute(), ApiExpandTemplates\execute(), PageExists\execute(), Undelete\execute(), ApiQueryLangLinks\execute(), ApiQueryTitleBlacklist\execute(), ApiQueryAllMessages\execute(), ApiQueryIWLinks\execute(), SpecialLog\execute(), ViewCLI\execute(), SpecialGoToInterwiki\execute(), FormatInstallDoc\execute(), NukePage\execute(), SpecialListGroupRights\execute(), SpecialPasswordPolicies\execute(), GetTextMaint\execute(), Protect\execute(), ApiParse\execute(), ApiQueryImageInfo\execute(), ApiQueryLogEvents\execute(), FixDoubleRedirects\execute(), SpecialWhatLinksHere\execute(), RollbackEdits\execute(), EditCLI\execute(), DumpIterator\execute(), ImportTextFiles\execute(), DeleteBatch\execute(), SpecialExpandTemplates\execute(), MoveBatch\execute(), BenchmarkParse\execute(), MovePageForm\execute(), SpecialEditTags\execute(), SpecialFileDuplicateSearch\execute(), UppercaseTitlesForUnicodeTransition\execute(), SpecialSearch\execute(), SpecialRevisionDelete\execute(), Scribunto_LuaEngine\expandTemplate(), SpecialEditWatchlist\extractTitles(), ResourceLoaderWikiModule\fetchTitleInfo(), SpecialMyLanguage\findTitle(), ApiHelp\fixHelpLinks(), Skin\footerLinkTitle(), ApiParse\formatIWLinks(), ApiParse\formatLangLinks(), Scribunto_LuaSandboxEngine\formatLimitData(), Linker\formatLinksInComment(), LogFormatter\formatParameterValue(), LogFormatter\formatParameterValueForApi(), SpecialMIMESearch\formatResult(), CoreParserFunctions\fullpagename(), CoreParserFunctions\fullpagenamee(), Scribunto_LuaLanguageLibrary\gender(), CoreParserFunctions\gender(), MoveLogFormatter\getActionLinks(), TitleBlacklist\getBlacklistText(), User\getCanonicalName(), Skin\getCategoryLinks(), ResourceLoaderWikiModule\getContent(), Scribunto_LuaTitleLibrary\getContentInternal(), Skin\getCopyright(), PageImages\Hooks\LinksUpdateHookHandler\getDbBlacklist(), ApiComparePages\getDiffRevision(), Scribunto\getDocPage(), SpecialUncategorizedCategories\getExceptionList(), Scribunto_LuaTitleLibrary\getExpensiveData(), ApiFeedRecentChanges\getFeedObject(), Scribunto_LuaTitleLibrary\getFileInfo(), HTMLFancyCaptchaFieldTest\getForm(), SpecialPageLanguage\getFormFields(), UserGroupMembership\getGroupPage(), SpecialStatistics\getGroupStats(), ApiPageSet\getInterwikiTitlesAsResult(), SkinTemplate\getLanguages(), IRCColourfulRCFeedFormatter\getLine(), SpecialExport\getLinks(), BlockLogFormatter\getMessageParameters(), MergeLogFormatter\getMessageParameters(), MoveLogFormatter\getMessageParameters(), ProtectLogFormatter\getMessageParameters(), SearchNearMatcher\getNearMatchInternal(), WantedFilesPage\getPageHeader(), UsersPager\getPageHeader(), getParentCategoryTree(), EditPage\getPreloadedContent(), MergeLogFormatter\getPreloadTitles(), ProtectLogFormatter\getPreloadTitles(), MoveLogFormatter\getPreloadTitles(), NewFilesPager\getQueryInfo(), ApiRollback\getRbTitle(), CssContent\getRedirectTarget(), JavaScriptContent\getRedirectTarget(), WikitextContent\getRedirectTargetAndText(), SpecialChangeCredentials\getReturnUrl(), Scribunto_LuaError\getScriptTraceHtml(), SpecialRecentChangesLinked\getTargetTitle(), ParserOutput\getText(), CLIParser\getTitle(), ApiBase\getTitleFromTitleOrPageId(), ResourceLoaderWikiModule\getTitleInfo(), ApiBase\getTitleOrPageId(), ApiQueryPageImages\getTitles(), Scribunto_LuaUriLibrary\getUrl(), Scribunto_LuaTitleLibrary\getUrl(), SpecialSearch\goResult(), ApiComparePages\guessTitle(), MediaWiki\Extensions\ParserFunctions\ParserFunctions\ifexistInternal(), ApiPageSet\initFromRevIDs(), TitleBlacklist\isBlacklisted(), Scribunto\isDocPage(), User\isValidUserName(), TitleBlacklist\isWhitelisted(), LogPager\limitTitle(), PageArchive\listPagesByPrefix(), PageArchive\listPagesBySearch(), LoginSignupSpecialPage\load(), Scribunto_LuaEngine\loadPackage(), SpecialUndelete\loadRequest(), SpecialMergeHistory\loadRequestParams(), ChangeTags\logTagManagementAction(), MediaWiki\main(), SkinTemplate\makeArticleUrlDetails(), PopulateArchiveRevId\makeDummyRevisionRow(), Skin\makeI18nUrl(), Skin\makeKnownUrlDetails(), SkinTemplate\makeTalkUrlDetails(), PPFuzzTester\makeTitle(), CategoryTree\makeTitle(), Skin\makeUrl(), Skin\makeUrlDetails(), TitleCleanup\moveIllegalPage(), ResourceLoaderContext\msg(), CoreParserFunctions\mwnamespace(), CoreParserFunctions\namespacee(), CoreParserFunctions\namespacenumber(), Scribunto_LuaEngine\newChildFrame(), ForeignAPIFile\newFromTitle(), newMainPage(), PageImages\Tests\PageImagesTest\newTitle(), Scribunto_LuaTitleLibrary\newTitle(), MediaWikiSite\normalizePageName(), SpecialCiteThisPage\onSubmit(), SpecialRandomInCategory\onSubmit(), SpecialChangeContentModel\onSubmit(), SpecialChangeEmail\onSuccess(), WikiExporter\pageByName(), CoreParserFunctions\pageid(), CoreParserFunctions\pagename(), CoreParserFunctions\pagenamee(), CoreParserFunctions\pagesize(), BenchmarkTitleValue\parseTitle(), ReplaceTextSearch\prefixCondition(), ApiQueryBase\prefixedTitlePartToKey(), SpecialPage\prefixSearchString(), SpecialCiteThisPage\prefixSearchSubpages(), CategoryTreePage\prefixSearchSubpages(), SpecialFileDuplicateSearch\prefixSearchSubpages(), ResourceLoaderWikiModule\preloadTitleInfo(), SearchEngine\processCompletionResults(), SpecialBlock\processForm(), WikiImporter\processLogItem(), TitleCleanup\processRow(), CleanupWatchlist\processRow(), CleanupCaps\processRowToUppercase(), CoreParserFunctions\protectionexpiry(), CoreParserFunctions\protectionlevel(), Scribunto_LuaTitleLibrary\protectionLevels(), PageImages\Tests\ApiQueryPageImagesTest\provideExecute(), PageImages\Tests\ApiQueryPageImagesTest\provideGetTitles(), PurgePage\purge(), LocalFile\recordUpload2(), SearchExactMatchRescorer\redirectTargetsToRedirect(), ImageMap\render(), SearchExactMatchRescorer\rescore(), CoreParserFunctions\revisionday(), CoreParserFunctions\revisionday2(), CoreParserFunctions\revisionid(), CoreParserFunctions\revisionmonth(), CoreParserFunctions\revisionmonth1(), CoreParserFunctions\revisiontimestamp(), CoreParserFunctions\revisionuser(), CoreParserFunctions\revisionyear(), SpecialComparePages\revOrTitle(), CoreParserFunctions\rootpagename(), CoreParserFunctions\rootpagenamee(), ApiQueryDeletedRevisions\run(), ApiQueryImages\run(), ApiQueryCategories\run(), ApiQueryLinks\run(), ApiQueryRecentChanges\run(), SpecialEditWatchlist\runWatchUnwatchCompleteHook(), SpecialChangeContentModel\setParameter(), WikiImporter\setTargetRootPage(), Scribunto_LuaTitleLibraryTest\setUp(), ResourceLoaderWikiModule\shouldEmbedModule(), EditPage\showCustomIntro(), SpecialGadgets\showMainForm(), SpecialSearch\showResults(), LoginHelper\showReturnToPage(), SpecialEditWatchlist\showTitles(), CoreParserFunctions\subjectpagename(), CoreParserFunctions\subjectpagenamee(), CoreParserFunctions\subjectspace(), CoreParserFunctions\subjectspacee(), WebInstallerName\submit(), CoreParserFunctions\subpagename(), CoreParserFunctions\subpagenamee(), Skin\subPageSubtitle(), SpecialCreateAccount\successfulAction(), CoreParserFunctions\talkpagename(), CoreParserFunctions\talkpagenamee(), CoreParserFunctions\talkspace(), CoreParserFunctions\talkspacee(), ScribuntoHooksTest\testContentHandlerDefaultModelFor(), BaseBlacklistTest\testGetTypeFromTitle(), CaptchaTest\testNamespaceTriggersOverwrite(), Scribunto_LuaCommonTest\testNonUtf8Errors(), HTMLReCaptchaNoCaptchaFieldTest\testSubmit(), MediaWiki\Extensions\ParserFunctions\ParserFunctions\titleparts(), and CoreParserFunctions\urlFunction().
|
static |
Like Title::newFromText(), but throws MalformedTitleException when the title is invalid, rather than returning null.
The exception subclasses encode detailed information about why the title is invalid.
Title objects returned by this method are guaranteed to be valid, and thus return true from the isValid() method.
string | $text | Title text to check |
int | $defaultNamespace |
MalformedTitleException | If the title is invalid |
Definition at line 353 of file Title.php.
References $t, $titleCache, MapCacheLRU\get(), getTitleCache(), NS_MAIN, and MapCacheLRU\set().
Referenced by SpecialRedirect\dispatchFile(), PageDataRequestHandler\handleRequest(), newFromText(), SpecialNewSection\onFormSubmit(), SpecialPageLanguage\onSubmit(), MediaWiki\parseTitle(), ApiPageSet\processTitlesArray(), HTMLTitleTextField\validate(), and SpecialChangeContentModel\validateTitle().
|
static |
Returns a Title given a TitleValue.
If the given TitleValue is already a Title instance, that instance is returned, unless $forceClone is "clone". If $forceClone is "clone" and the given TitleValue is already a Title instance, that instance is copied using the clone operator.
TitleValue | $titleValue | Assumed to be safe. |
string | $forceClone | set to NEW_CLONE to ensure a fresh instance is returned. |
Definition at line 253 of file Title.php.
References newFromLinkTarget().
Referenced by SpecialPage\getTitleFor(), and SpecialEditWatchlist\runWatchUnwatchCompleteHook().
|
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 404 of file Title.php.
References $t.
Referenced by Scribunto_LuaUriLibrary\getUrl(), MediaWiki\parseTitle(), and CoreParserFunctions\urlFunction().
|
static |
Create a new Title for the Main Page.
This uses the 'mainpage' interface message, which could be specified in $wgForceUIMsgAsContentMsg
. If that is the case, then calling this method will use the user language, which would involve initialising the session via RequestContext::getMain()->getLanguage()
. For session-less endpoints, be sure to pass in a MessageLocalizer (such as your own RequestContext, or ResourceloaderContext) to prevent an error.
MessageLocalizer | null | $localizer | An optional context to use (since 1.34) |
Definition at line 649 of file Title.php.
References $title, newFromText(), and wfMessage().
Referenced by EmaillingJob\__construct(), Skin\addToSidebarPlain(), Installer\createMainpage(), ApiRsd\execute(), InitImageData\execute(), FileDeleteForm\execute(), MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), SpecialChangeCredentials\getAuthForm(), OOUIHTMLForm\getButtons(), VFormHTMLForm\getButtons(), HTMLForm\getButtons(), SpecialMyLanguage\getRedirect(), Scribunto_LuaEngineTestBase\getTestTitle(), getTestTitle(), XmlDumpWriter\homelink(), Skin\logoText(), Skin\mainPageLink(), PopulateArchiveRevId\makeDummyRevisionRow(), Scribunto_LuaEnvironmentComparisonTest\makeEngine(), Skin\makeMainPageUrl(), makeSuite(), SpecialChangeEmail\onSuccess(), MediaWiki\parseTitle(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\sendNewAccountEmail(), MediaWiki\Auth\TemporaryPasswordPrimaryAuthenticationProvider\sendPasswordResetEmail(), LoginHelper\showReturnToPage(), MediaWikiTitleCodec\splitTitleString(), and SpamBlacklistTest\testSpam().
Title::pageCond | ( | ) |
Get an associative array for selecting this title from the "page" table.
Definition at line 3819 of file Title.php.
References $mArticleID, $mDbkeyform, and $mNamespace.
Referenced by getTouched(), invalidateCache(), isNewPage(), isSingleRevRedirect(), and loadFieldFromDB().
|
private |
Prefix some arbitrary text with the namespace or interwiki prefix of this object.
string | $name | The text |
Definition at line 1780 of file Title.php.
References getNsText(), isExternal(), and NS_SPECIAL.
Referenced by getPrefixedDBkey(), getPrefixedText(), and getPrefixedURL().
|
static |
Purge expired restrictions from the page_restrictions table.
This will purge no more than $wgUpdateRowsPerQuery page_restrictions rows
Definition at line 2974 of file Title.php.
References Wikimedia\Rdbms\IDatabase\addQuotes(), DeferredUpdates\addUpdate(), DB_MASTER, Wikimedia\Rdbms\IDatabase\delete(), Wikimedia\Rdbms\IDatabase\selectFieldValues(), Wikimedia\Rdbms\IDatabase\timestamp(), wfGetDB(), and wfReadOnly().
Referenced by WikiPage\doUpdateRestrictions().
Title::purgeSquid | ( | ) |
Purge all applicable CDN URLs.
Definition at line 3534 of file Title.php.
References DeferredUpdates\addUpdate(), getCdnUrls(), and DeferredUpdates\PRESEND.
Referenced by File\purgeDescription().
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 | null | $user | User to check (since 1.19); $wgUser will be used if not provided. |
Exception |
Definition at line 2335 of file Title.php.
References userCan().
Title::resetArticleID | ( | $id | ) |
Inject a page ID, reset DB-loaded fields, and clear the link cache for this title.
This can be called on page insertion to allow loading of the new page_id without having to create a new Title instance. Likewise with deletion.
int | bool | $id | Page ID, 0 for non-existant, or false for "unknown" (lazy-load) |
|
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.
MalformedTitleException | On invalid titles |
Definition at line 3301 of file Title.php.
References isExternal(), isSpecialPage(), setFragment(), and wfUrlencode().
Title::setContentModel | ( | $model | ) |
Set a proposed content model for the page for permissions checking.
This does not actually change the content model of a title in the DB. It only affects this particular Title instance. The content model is forced to remain this value until another setContentModel() call.
ContentHandler::canBeUsedOn() should be checked before calling this if there is any doubt regarding the applicability of the content model
string | $model | CONTENT_MODEL_XXX constant |
Definition at line 1099 of file Title.php.
Referenced by EditPage\internalAttemptSave(), and SpecialChangeContentModel\onSubmit().
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, or Title::createFragmentTarget(). Still in active use privately.
string | $fragment | Text |
Definition at line 1753 of file Title.php.
Referenced by secureAndSplit().
Title::touchLinks | ( | ) |
Update page_touched timestamps and send CDN 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.
Definition at line 4351 of file Title.php.
References HTMLCacheUpdateJob\newForBacklinks(), NS_CATEGORY, and JobQueueGroup\singleton().
Title::userCan | ( | $action, | |
$user = null , |
|||
$rigor = PermissionManager::RIGOR_SECURE |
|||
) |
Can $user perform $action on this page?
string | $action | Action that permission needs to be checked for |
User | null | $user | User to check (since 1.19); $wgUser will be used if not provided. |
string | $rigor | Same format as Title::getUserPermissionsErrors() |
Exception |
Definition at line 2354 of file Title.php.
Referenced by quickUserCan().
|
private |
Title | $title | |
string | $method |
Definition at line 1640 of file Title.php.
References getFullText(), getInterwiki(), getText(), and wfLogWarning().
Referenced by getSubjectPage(), and getTalkPage().
Title::wasLocalInterwiki | ( | ) |
Was this a local interwiki link?
Definition at line 932 of file Title.php.
References $mLocalInterwiki.
int Title::$mArticleID = -1 |
Article ID, fetched from the link cache on demand.
Definition at line 94 of file Title.php.
Referenced by getArticleID(), and pageCond().
bool Title::$mCascadeRestriction |
Cascade restrictions on this page to included templates and images?
Definition at line 126 of file Title.php.
Referenced by areRestrictionsCascading().
array Title::$mCascadeSources |
Where are the cascading restrictions coming from on this page?
Definition at line 138 of file Title.php.
Referenced by getCascadeProtectionSources().
Title::$mCascadingRestrictions |
Caching the results of getCascadeProtectionSources.
Definition at line 129 of file Title.php.
Referenced by getCascadeProtectionSources().
|
private |
ID of the page's content model, i.e.
one of the CONTENT_MODEL_XXX constants
Definition at line 103 of file Title.php.
Referenced by getContentModel().
string Title::$mDbkeyform = '' |
Main part with underscores.
Definition at line 81 of file Title.php.
Referenced by getCascadeProtectionSources(), getDBkey(), getRedirectsHere(), getUserCaseDBKey(), and pageCond().
|
private |
The page language code from the database, null if not saved in the database or false if not loaded, yet.
Definition at line 181 of file Title.php.
Referenced by getDbPageLanguageCode().
int Title::$mDefaultNamespace = NS_MAIN |
Namespace index when there is no namespace.
Don't change the following default, NS_MAIN is hardcoded in several places. See T2696. Zero except in {{transclusion}} tags.
Definition at line 161 of file Title.php.
Referenced by getDefaultNamespace().
|
private |
Estimated number of revisions; null of not loaded.
Definition at line 112 of file Title.php.
Referenced by estimateRevisionCount().
|
private |
If a content model was forced via setContentModel() this will be true to avoid having other code paths reset it.
string Title::$mFragment = '' |
Title fragment (i.e.
the bit after the #)
Definition at line 91 of file Title.php.
Referenced by getFragment(), and getFullText().
|
protected |
Are cascading restrictions in effect on this page?
Definition at line 135 of file Title.php.
Referenced by getCascadeProtectionSources().
|
private |
Whether a page has any subpages.
Definition at line 173 of file Title.php.
Referenced by hasSubpages().
string Title::$mInterwiki = '' |
Interwiki prefix.
Definition at line 87 of file Title.php.
Referenced by getInterwiki(), and getRedirectsHere().
|
private |
Would deleting this page be a big deletion?
Definition at line 187 of file Title.php.
Referenced by isBigDeletion().
|
protected |
ID of most recent revision.
Definition at line 97 of file Title.php.
Referenced by getLatestRevID().
|
protected |
The page length, 0 for special pages.
Definition at line 164 of file Title.php.
Referenced by getLength().
|
private |
Was this Title created from a string with a local interwiki prefix?
Definition at line 89 of file Title.php.
Referenced by wasLocalInterwiki().
int Title::$mNamespace = NS_MAIN |
Namespace index, i.e.
one of the NS_xxxx constants
Definition at line 85 of file Title.php.
Referenced by getCascadeProtectionSources(), getEditNotices(), getNamespace(), getRedirectsHere(), getSubpages(), and pageCond().
|
private |
|
protected |
|
private |
null Title::$mRedirect = null |
Is the article at this title a redirect?
Definition at line 167 of file Title.php.
Referenced by isRedirect().
array Title::$mRestrictions = [] |
Array of groups allowed to edit this article.
Definition at line 115 of file Title.php.
Referenced by getAllRestrictions().
|
protected |
bool Title::$mRestrictionsLoaded = false |
Boolean for initialisation on demand.
Definition at line 141 of file Title.php.
Referenced by areRestrictionsLoaded().
string Title::$mTextform = '' |
Text form (spaces not underscores) of the main part.
Definition at line 77 of file Title.php.
Referenced by getSubpageText(), and getText().
mixed Title::$mTitleProtection |
Cached value for getTitleProtection (create protection)
Definition at line 154 of file Title.php.
Referenced by getTitleProtectionInternal().
|
private |
A corresponding TitleValue object.
Definition at line 184 of file Title.php.
Referenced by getTitleValue().
string Title::$mUrlform = '' |
URL-encoded form of the main part.
Definition at line 79 of file Title.php.
Referenced by getPartialURL().
|
protected |
Database key with the initial letter in the case specified by the user.
Definition at line 83 of file Title.php.
Referenced by getUserCaseDBKey().
string null Title::$prefixedText = null |
Text form including namespace/interwiki, initialised on demand.
Only public to share cache with TitleFormatter
Definition at line 151 of file Title.php.
Referenced by getPrefixedText().
|
staticprivate |
Definition at line 44 of file Title.php.
Referenced by clearCaches(), getTitleCache(), and newFromTextThrow().
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.
const Title::GAID_FOR_UPDATE = 512 |
Used to be GAID_FOR_UPDATE define().
Used with getArticleID() and friends to use the master DB and inject it into link cache.
Definition at line 58 of file Title.php.
Referenced by getFirstRevision(), loadFieldFromDB(), and newFromID().
const Title::NEW_CLONE = 'clone' |
Flag for use with factory methods like newFromLinkTarget() that have a $forceClone parameter.
If set, the method must return a new instance. Without this flag, some factory methods may return existing instances.