ILIAS
Release_4_2_x_branch Revision 61807
|
Public Member Functions | |
isLocal () | |
Determine whether the object refers to a page within this project. | |
isTrans () | |
Determine whether the object refers to a page within this project and is transcludable. | |
getText () | |
Simple accessors. | |
getPartialURL () | |
Get the URL-encoded form of the main part. | |
getDBkey () | |
Get the main part with underscores. | |
getNamespace () | |
Get the namespace index, i.e. | |
getNsText () | |
Get the namespace text. | |
getInterwiki () | |
Get the namespace text of the subject (rather than talk) page. | |
getFragment () | |
Get the Title fragment (i.e. | |
getFragmentForURL () | |
Get the fragment in URL form, including the "#" character if there is one. | |
getDefaultNamespace () | |
Get the default namespace index, for when there is no namespace. | |
getIndexTitle () | |
Get title for search index. | |
getPrefixedDBkey () | |
Get the prefixed database key form. | |
getPrefixedText () | |
Get the prefixed title with spaces. | |
getFullText () | |
Get the prefixed title with spaces, plus any fragment (part beginning with '#') | |
getBaseText () | |
Get the base name, i.e. | |
getSubpageText () | |
Get the lowest-level subpage name, i.e. | |
getSubpageUrlForm () | |
Get a URL-encoded form of the subpage text. | |
getPrefixedURL () | |
Get a URL-encoded title (not an actual URL) including interwiki. | |
getFullURL ($query= '', $variant=false) | |
Get a real URL referring to this title, with interwiki link and fragment. | |
getLocalURL ($query= '', $variant=false) | |
Get a URL with no fragment or server name. | |
escapeLocalURL ($query= '') | |
Get an HTML-escaped version of the URL form, suitable for using in a link, without a server name or fragment. | |
escapeFullURL ($query= '') | |
Get an HTML-escaped version of the URL form, suitable for using in a link, including the server name and fragment. | |
getInternalURL ($query= '', $variant=false) | |
Get the URL form for an internal link. | |
getEditURL () | |
Get the edit URL for this Title. | |
getEscapedText () | |
Get the HTML-escaped displayable text form. | |
isExternal () | |
Is this Title interwiki? | |
isSemiProtected ($action= 'edit') | |
Is this page "semi-protected" - the only protection is autoconfirm? | |
isProtected ($action= '') | |
Does the title correspond to a protected article? | |
userIsWatching () | |
Is $wgUser is watching this page? | |
quickUserCan ($action) | |
Can $wgUser perform $action on this page? This skips potentially expensive cascading permission checks. | |
userCan ($action, $doExpensiveQueries=true) | |
Can $wgUser perform $action on this page? | |
userCanEdit ($doExpensiveQueries=true) | |
Can $wgUser edit this page? | |
userCanCreate ($doExpensiveQueries=true) | |
Can $wgUser create this page? | |
userCanMove ($doExpensiveQueries=true) | |
Can $wgUser move this page? | |
userCanRead () | |
Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable. | |
isSubpage () | |
Is this a talk page of some sort? | |
isCssJsSubpage () | |
Is this a .css or .js subpage of a user page? | |
isValidCssJsSubpage () | |
Is this a valid .css or .js subpage of a user page? Check that the corresponding skin exists. | |
getSkinFromCssJsSubpage () | |
Trim down a .css or .js subpage title to get the corresponding skin name. | |
isCssSubpage () | |
Is this a .css subpage of a user page? | |
isJsSubpage () | |
Is this a .js subpage of a user page? | |
userCanEditCssJsSubpage () | |
Protect css/js subpages of user pages: can $wgUser edit this page? | |
isCascadeProtected () | |
Cascading protection: Return true if cascading restrictions apply to this page, false if not. | |
getCascadeProtectionSources ($get_pages=true) | |
Cascading protection: Get the source of any cascading restrictions on this page. | |
areRestrictionsCascading () | |
loadRestrictions ($oldFashionedRestrictions=NULL) | |
getRestrictions ($action) | |
Accessor/initialisation for mRestrictions. | |
isDeleted () | |
Is there a version of this page in the deletion archive? | |
getArticleID ($flags=0) | |
Get the article ID for this Title from the link cache, adding it if necessary. | |
getLatestRevID () | |
resetArticleID ($newid) | |
This clears some fields in this object, and clears any associated keys in the "bad links" section of the link cache. | |
invalidateCache () | |
Updates page_touched for this page; called from LinksUpdate.php. | |
setFragment ($fragment) | |
Set the fragment for this title This is kind of bad, since except for this rarely-used function, Title objects are immutable. | |
getLinksTo ($options= '', $table= 'pagelinks', $prefix= 'pl') | |
Get a Title object associated with the talk page of this article. | |
getTemplateLinksTo ($options= '') | |
Get an array of Title objects using this Title as a template Also stores the IDs in the link cache. | |
getBrokenLinksFrom ($options= '') | |
Get an array of Title objects referring to non-existent articles linked from this page. | |
getSquidURLs () | |
Get a list of URLs to purge from the Squid cache when this page changes. | |
purgeSquid () | |
moveNoAuth (&$nt) | |
Move this page without authentication. | |
isValidMoveOperation (&$nt, $auth=true) | |
Check whether a given move operation would be valid. | |
moveTo (&$nt, $auth=true, $reason= '') | |
Move a title to a new location. | |
isValidMoveTarget ($nt) | |
Checks if $this can be moved to a given Title. | |
getParentCategories () | |
Get categories to which this Title belongs and return an array of categories' names. | |
getParentCategoryTree ($children=array()) | |
Get a tree of parent categories. | |
pageCond () | |
Get an associative array for selecting this title from the "page" table. | |
getPreviousRevisionID ($revision) | |
Get the revision ID of the previous revision. | |
getNextRevisionID ($revision) | |
Get the revision ID of the next revision. | |
countRevisionsBetween ($old, $new) | |
Get the number of revisions between the given revision IDs. | |
equals ($title) | |
Compare with another title. | |
exists () | |
Check if page exists. | |
isAlwaysKnown () | |
Should a link should be displayed as a known link, just based on its title? | |
touchLinks () | |
Update page_touched timestamps and send squid purge messages for pages linking to this title. | |
getTouched () | |
Get the last touched timestamp. | |
trackbackURL () | |
trackbackRDF () | |
getNamespaceKey () | |
Generate strings used for xml 'id' names in monobook tabs. | |
isSpecial ($name) | |
Returns true if this title resolves to the named special page. | |
fixSpecialName () | |
If the Title refers to a special page alias which is not the local default, returns a new Title which points to the local default. |
Static Public Member Functions | |
static | newFromDBkey ($key) |
Create a new Title from a prefixed DB key. | |
static | newFromText ($text, $defaultNamespace=NS_MAIN) |
Create a new Title from text, such as what one would find in a link. | |
static | newFromURL ($url) |
Create a new Title from URL-encoded text. | |
static | newFromID ($id) |
Create a new Title from an article ID. | |
static | newFromIDs ($ids) |
Make an array of titles from an array of IDs. | |
static & | makeTitle ($ns, $title) |
Create a new Title from a namespace index and a DB key. | |
static | makeTitleSafe ($ns, $title) |
Create a new Title from a namespace index and a DB key. | |
static | newMainPage () |
Create a new Title for the Main Page. | |
static | newFromRedirect ($text) |
Create a new Title for a redirect. | |
nameOf ($id) | |
Get the prefixed DB key associated with an ID. | |
static | legalChars () |
Get a regex character class describing the legal characters in a link. | |
static | indexTitle ($ns, $title) |
Get a string representation of a title suitable for including in a search index. | |
static | makeName ($ns, $title) |
getInterwikiLink ($key) | |
Returns the URL associated with an interwiki prefix. | |
static | getInterwikiCached ($key) |
Fetch interwiki prefix data from local cache in constant database. | |
static | escapeFragmentForURL ($fragment) |
Escape a text fragment, say from a link, for a URL. | |
static | purgeExpiredRestrictions () |
Purge expired restrictions from the page_restrictions table. |
Private Member Functions | |
__construct () | |
#@- | |
loadRestrictionsFromRow ($res, $oldFashionedRestrictions=NULL) | |
Loads a string into mRestrictions array. | |
prefix ($name) | |
Prefix some arbitrary text with the namespace or interwiki prefix of this object. | |
secureAndSplit () | |
Secure and split - main initialisation function for this object. | |
moveOverExistingRedirect (&$nt, $reason= '') | |
Move page to a title which is at present a redirect to the source page. | |
moveToNewTitle (&$nt, $reason= '') | |
Move page to non-existing title. |
Private Attributes | |
$mTextform | |
All member variables should be considered private Please use the accessor functions. |
Static Private Attributes | |
static | $titleCache = array() |
Static cache variables. | |
static | $interwikiCache = array() |
Title class.
|
private |
#@-
Constructor
Definition at line 72 of file Title.php.
Title::areRestrictionsCascading | ( | ) |
Definition at line 1359 of file Title.php.
References $mCascadeRestriction, and loadRestrictions().
Title::countRevisionsBetween | ( | $old, | |
$new | |||
) |
Get the number of revisions between the given revision IDs.
integer | $old | Revision ID. |
integer | $new | Revision ID. |
Definition at line 2383 of file Title.php.
Title::equals | ( | $title | ) |
Compare with another title.
Title | $title |
Definition at line 2397 of file Title.php.
References $title, getInterwiki(), and getNamespace().
Referenced by isValidMoveOperation().
|
static |
Escape a text fragment, say from a link, for a URL.
Definition at line 509 of file Title.php.
References Sanitizer\decodeCharReferences().
Referenced by getFragmentForURL().
Title::escapeFullURL | ( | $query = '' | ) |
Get an HTML-escaped version of the URL form, suitable for using in a link, including the server name and fragment.
string | $query | an optional query string |
Definition at line 857 of file Title.php.
References $query, and getFullURL().
Title::escapeLocalURL | ( | $query = '' | ) |
Get an HTML-escaped version of the URL form, suitable for using in a link, without a server name or fragment.
string | $query | an optional query string |
Definition at line 846 of file Title.php.
References $query, and getLocalURL().
Title::exists | ( | ) |
Check if page exists.
Definition at line 2408 of file Title.php.
Referenced by getRestrictions(), isSemiProtected(), and isValidMoveOperation().
Title::fixSpecialName | ( | ) |
If the Title refers to a special page alias which is not the local default, returns a new Title which points to the local default.
Otherwise, returns $this.
Definition at line 2534 of file Title.php.
References getNamespace(), and makeTitle().
Title::getArticleID | ( | $flags = 0 | ) |
Get the article ID for this Title from the link cache, adding it if necessary.
int | $flags | a bit field; may be GAID_FOR_UPDATE to select for update |
Definition at line 1501 of file Title.php.
References $mArticleID, and GAID_FOR_UPDATE.
Referenced by getLatestRevID(), isValidMoveOperation(), moveTo(), and moveToNewTitle().
Title::getBaseText | ( | ) |
Get the base name, i.e.
the leftmost parts before the /
Definition at line 669 of file Title.php.
References getText().
Title::getBrokenLinksFrom | ( | $options = '' | ) |
Get an array of Title objects referring to non-existent articles linked from this page.
string | $options | may be FOR UPDATE |
Definition at line 1879 of file Title.php.
References $res, $row, and makeTitle().
Title::getCascadeProtectionSources | ( | $get_pages = true | ) |
Cascading protection: Get the source of any cascading restrictions on this page.
$get_pages | bool Whether or not to retrieve the actual pages that the restrictions have come from. |
Definition at line 1272 of file Title.php.
References $res, $row, getDBkey(), getNamespace(), makeTitle(), and purgeExpiredRestrictions().
Referenced by isCascadeProtected(), and userCan().
Title::getDBkey | ( | ) |
Get the main part with underscores.
Definition at line 538 of file Title.php.
References $mDbkeyform.
Referenced by getCascadeProtectionSources(), getTouched(), invalidateCache(), isDeleted(), isSpecial(), and isValidMoveOperation().
Title::getDefaultNamespace | ( | ) |
Get the default namespace index, for when there is no namespace.
Definition at line 615 of file Title.php.
References $mDefaultNamespace.
Title::getEditURL | ( | ) |
Get the edit URL for this Title.
Definition at line 882 of file Title.php.
References getLocalURL().
Title::getEscapedText | ( | ) |
Get the HTML-escaped displayable text form.
Used for the title field in tags.
Definition at line 894 of file Title.php.
References getPrefixedText().
Title::getFragment | ( | ) |
Get the Title fragment (i.e.
the bit after the #) in text form
Definition at line 599 of file Title.php.
References $mFragment.
Title::getFragmentForURL | ( | ) |
Get the fragment in URL form, including the "#" character if there is one.
Definition at line 604 of file Title.php.
References escapeFragmentForURL().
Referenced by getFullURL().
Title::getFullText | ( | ) |
Get the prefixed title with spaces, plus any fragment (part beginning with '#')
Definition at line 657 of file Title.php.
References $mFragment, and getPrefixedText().
Referenced by getParentCategories().
Title::getFullURL | ( | $query = '' , |
|
$variant = false |
|||
) |
Get a real URL referring to this title, with interwiki link and fragment.
string | $query | an optional query string, not used for interwiki links |
string | $variant | language variant of url (for sr, zh..) |
Definition at line 733 of file Title.php.
References $namespace, $query, getFragmentForURL(), getInterwikiLink(), and getNsText().
Referenced by escapeFullURL(), getLocalURL(), and trackbackRDF().
Title::getIndexTitle | ( | ) |
Get title for search index.
Definition at line 622 of file Title.php.
References indexTitle().
Title::getInternalURL | ( | $query = '' , |
|
$variant = false |
|||
) |
Get the URL form for an internal link.
string | $query | an optional query string |
string | $variant | language variant of url (for sr, zh..) |
Definition at line 870 of file Title.php.
References $query, and getLocalURL().
Referenced by getSquidURLs().
Title::getInterwiki | ( | ) |
Get the namespace text of the subject (rather than talk) page.
Definition at line 594 of file Title.php.
References $mInterwiki.
Referenced by equals().
|
static |
Fetch interwiki prefix data from local cache in constant database.
More logic is explained in DefaultSettings
Definition at line 438 of file Title.php.
References $interwikiCache.
Referenced by getInterwikiLink().
|
static |
Returns the URL associated with an interwiki prefix.
string | $key | the interwiki prefix (e.g. "MeatBall") |
Definition at line 383 of file Title.php.
References $interwikiCache, $res, and getInterwikiCached().
Referenced by getFullURL(), isLocal(), isTrans(), and secureAndSplit().
Title::getLatestRevID | ( | ) |
Definition at line 1515 of file Title.php.
References $mLatestID, and getArticleID().
Title::getLinksTo | ( | $options = '' , |
|
$table = 'pagelinks' , |
|||
$prefix = 'pl' |
|||
) |
Get a Title object associated with the talk page of this article.
WARNING: do not use this function on arbitrary user-supplied titles! On heavily-used templates it will max out the memory.
string | $options | may be FOR UPDATE |
Definition at line 1828 of file Title.php.
References $res, $row, getNamespace(), and makeTitle().
Referenced by getTemplateLinksTo().
Title::getLocalURL | ( | $query = '' , |
|
$variant = false |
|||
) |
Get a URL with no fragment or server name.
If this page is generated with action=render, $wgServer is prepended.
string | $query | an optional query string; if not specified, $wgArticlePath will be used. |
string | $variant | language variant of url (for sr, zh..) |
Definition at line 772 of file Title.php.
References $query, getFullURL(), getPrefixedDBkey(), and isExternal().
Referenced by escapeLocalURL(), getEditURL(), and getInternalURL().
Title::getNamespace | ( | ) |
Get the namespace index, i.e.
one of the NS_xxxx constants
Definition at line 543 of file Title.php.
References $mNamespace.
Referenced by equals(), fixSpecialName(), getCascadeProtectionSources(), getLinksTo(), getNamespaceKey(), getTouched(), invalidateCache(), isDeleted(), isProtected(), isSpecial(), touchLinks(), and userCanRead().
Title::getNamespaceKey | ( | ) |
Generate strings used for xml 'id' names in monobook tabs.
Definition at line 2480 of file Title.php.
References getNamespace().
Title::getNextRevisionID | ( | $revision | ) |
Get the revision ID of the next revision.
integer | $revision | Revision ID. Get the revision that was after this one. |
Definition at line 2369 of file Title.php.
References $revision.
Title::getNsText | ( | ) |
Get the namespace text.
Definition at line 548 of file Title.php.
References $mNamespace.
Referenced by getFullURL(), and prefix().
Title::getParentCategories | ( | ) |
Get categories to which this Title belongs and return an array of categories' names.
Definition at line 2287 of file Title.php.
References $data, $res, and getFullText().
Referenced by getParentCategoryTree().
Title::getParentCategoryTree | ( | $children = array() | ) |
Get a tree of parent categories.
array | $children | an array with the children in the keys, to check for circular refs |
Definition at line 2318 of file Title.php.
References getParentCategories(), and newFromText().
Title::getPartialURL | ( | ) |
Get the URL-encoded form of the main part.
Definition at line 533 of file Title.php.
References $mUrlform.
Title::getPrefixedDBkey | ( | ) |
Get the prefixed database key form.
Definition at line 631 of file Title.php.
References prefix().
Referenced by getLocalURL(), isValidMoveTarget(), moveToNewTitle(), and resetArticleID().
Title::getPrefixedText | ( | ) |
Get the prefixed title with spaces.
This is the form usually used for display
Definition at line 642 of file Title.php.
References $mPrefixedText, and prefix().
Referenced by getEscapedText(), getFullText(), moveToNewTitle(), and userCanRead().
Title::getPrefixedURL | ( | ) |
Get a URL-encoded title (not an actual URL) including interwiki.
Definition at line 711 of file Title.php.
References prefix().
Title::getPreviousRevisionID | ( | $revision | ) |
Get the revision ID of the previous revision.
integer | $revision | Revision ID. Get the revision that was before this one. |
Definition at line 2356 of file Title.php.
References $revision.
Title::getRestrictions | ( | $action | ) |
Accessor/initialisation for mRestrictions.
string | $action | action that permission needs to be checked for |
Definition at line 1461 of file Title.php.
References exists(), and loadRestrictions().
Referenced by isProtected(), isSemiProtected(), and userCan().
Title::getSkinFromCssJsSubpage | ( | ) |
Trim down a .css or .js subpage title to get the corresponding skin name.
Definition at line 1223 of file Title.php.
Referenced by isValidCssJsSubpage().
Title::getSquidURLs | ( | ) |
Get a list of URLs to purge from the Squid cache when this page changes.
Definition at line 1917 of file Title.php.
References getInternalURL().
Referenced by purgeSquid().
Title::getSubpageText | ( | ) |
Get the lowest-level subpage name, i.e.
the rightmost part after /
Definition at line 686 of file Title.php.
Referenced by getSubpageUrlForm().
Title::getSubpageUrlForm | ( | ) |
Get a URL-encoded form of the subpage text.
Definition at line 700 of file Title.php.
References getSubpageText().
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.
string | $options | may be FOR UPDATE |
Definition at line 1869 of file Title.php.
References getLinksTo().
Title::getText | ( | ) |
Simple accessors.
Get the text form (spaces not underscores) of the main part
Definition at line 528 of file Title.php.
References $mTextform.
Referenced by getBaseText(), isSubpage(), and trackbackRDF().
Title::getTouched | ( | ) |
Get the last touched timestamp.
Definition at line 2441 of file Title.php.
References getDBkey(), and getNamespace().
|
static |
Get a string representation of a title suitable for including in a search index.
int | $ns | a namespace index |
string | $title | text-form main part |
Definition at line 343 of file Title.php.
Referenced by getIndexTitle().
Title::invalidateCache | ( | ) |
Updates page_touched for this page; called from LinksUpdate.php.
Definition at line 1550 of file Title.php.
References $success, getDBkey(), and getNamespace().
Title::isAlwaysKnown | ( | ) |
Should a link should be displayed as a known link, just based on its title?
Currently, a self-link with a fragment and special pages are in this category. Special pages never exist in the database.
Definition at line 2418 of file Title.php.
References $mDbkeyform, and isExternal().
Title::isCascadeProtected | ( | ) |
Cascading protection: Return true if cascading restrictions apply to this page, false if not.
Definition at line 1259 of file Title.php.
References getCascadeProtectionSources().
Title::isCssJsSubpage | ( | ) |
Is this a .css or .js subpage of a user page?
Definition at line 1205 of file Title.php.
Referenced by isValidCssJsSubpage(), and userCan().
Title::isCssSubpage | ( | ) |
Title::isDeleted | ( | ) |
Is there a version of this page in the deletion archive?
Definition at line 1478 of file Title.php.
References $n, getDBkey(), and getNamespace().
Title::isExternal | ( | ) |
Is this Title interwiki?
Definition at line 902 of file Title.php.
Referenced by getLocalURL(), and isAlwaysKnown().
Title::isJsSubpage | ( | ) |
Title::isLocal | ( | ) |
Determine whether the object refers to a page within this project.
Definition at line 480 of file Title.php.
References $interwikiCache, and getInterwikiLink().
Title::isProtected | ( | $action = '' | ) |
Does the title correspond to a protected article?
string | $what | the action the page is protected from, by default checks move and edit |
Definition at line 935 of file Title.php.
References getNamespace(), and getRestrictions().
Title::isSemiProtected | ( | $action = 'edit' | ) |
Is this page "semi-protected" - the only protection is autoconfirm?
string | Action to check (default: edit) |
Definition at line 910 of file Title.php.
References exists(), and getRestrictions().
Title::isSpecial | ( | $name | ) |
Returns true if this title resolves to the named special page.
string | $name | The special page name |
Definition at line 2520 of file Title.php.
References getDBkey(), and getNamespace().
Referenced by userCanRead().
Title::isSubpage | ( | ) |
Is this a talk page of some sort?
Definition at line 1191 of file Title.php.
References getText().
Title::isTrans | ( | ) |
Determine whether the object refers to a page within this project and is transcludable.
Definition at line 497 of file Title.php.
References $interwikiCache, and getInterwikiLink().
Title::isValidCssJsSubpage | ( | ) |
Is this a valid .css or .js subpage of a user page? Check that the corresponding skin exists.
Definition at line 1212 of file Title.php.
References getSkinFromCssJsSubpage(), and isCssJsSubpage().
Title::isValidMoveOperation | ( | & | $nt, |
$auth = true |
|||
) |
Check whether a given move operation would be valid.
Returns true if ok, or a message key string for an error message if invalid. (Scarrrrry ugly interface this.)
Title | &$nt | the new title |
bool | $auth | indicates whether $wgUser's permissions should be checked |
Definition at line 1963 of file Title.php.
References $auth, equals(), exists(), getArticleID(), getDBkey(), isValidMoveTarget(), and userCan().
Referenced by moveTo().
Title::isValidMoveTarget | ( | $nt | ) |
Checks if $this can be moved to a given Title.
Title | &$nt | the new title to check |
Definition at line 2231 of file Title.php.
References $row, getPrefixedDBkey(), and newFromText().
Referenced by isValidMoveOperation().
|
static |
Get a regex character class describing the legal characters in a link.
Definition at line 326 of file Title.php.
Referenced by secureAndSplit().
Title::loadRestrictions | ( | $oldFashionedRestrictions = NULL | ) |
Definition at line 1434 of file Title.php.
References $res, and loadRestrictionsFromRow().
Referenced by areRestrictionsCascading(), and getRestrictions().
|
private |
Loads a string into mRestrictions array.
resource | $res | restrictions as an SQL result. |
Definition at line 1371 of file Title.php.
References $res, $row, and purgeExpiredRestrictions().
Referenced by loadRestrictions().
|
static |
|
static |
Create a new Title from a namespace index and a DB key.
It's assumed that $ns and $title are valid, for instance when they came directly from the database or a special page name. For convenience, spaces are converted to underscores so that eg user_text fields can be used directly.
int | $ns | the namespace of the article |
string | $title | the unprefixed database key form |
Definition at line 231 of file Title.php.
Referenced by fixSpecialName(), getBrokenLinksFrom(), getCascadeProtectionSources(), getLinksTo(), newFromID(), and newFromIDs().
|
static |
Create a new Title from a namespace index and a DB key.
The parameters will be checked for validity, which is a bit slower than makeTitle() but safer for user-provided data.
int | $ns | the namespace of the article |
string | $title | the database key form |
Definition at line 252 of file Title.php.
References $t, $title, and makeName().
Title::moveNoAuth | ( | & | $nt | ) |
|
private |
Move page to a title which is at present a redirect to the source page.
Title | &$nt | the page to move to, which should currently be a redirect |
Definition at line 2083 of file Title.php.
Referenced by moveTo().
Title::moveTo | ( | & | $nt, |
$auth = true , |
|||
$reason = '' |
|||
) |
Move a title to a new location.
Title | &$nt | the new title |
bool | $auth | indicates whether $wgUser's permissions should be checked |
Definition at line 2011 of file Title.php.
References $auth, getArticleID(), isValidMoveOperation(), and moveOverExistingRedirect().
Referenced by moveNoAuth().
|
private |
Move page to non-existing title.
Definition at line 2160 of file Title.php.
References $comment, $log, getArticleID(), getPrefixedDBkey(), getPrefixedText(), and purgeSquid().
|
static |
Get the prefixed DB key associated with an ID.
int | $id | the page_id of the article |
Definition at line 311 of file Title.php.
References $n, and makeName().
|
static |
|
static |
Create a new Title from an article ID.
int | $id | the page_id corresponding to the Title to create |
Definition at line 192 of file Title.php.
References $row, $title, and makeTitle().
|
static |
Make an array of titles from an array of IDs.
Definition at line 208 of file Title.php.
References $res, $row, and makeTitle().
|
static |
Create a new Title for a redirect.
string | $text | the redirect title text |
Definition at line 276 of file Title.php.
References newFromText().
|
static |
Create a new Title from text, such as what one would find in a link.
Decodes any HTML entities in the text.
string | $text | the link text; spaces, prefixes, and an initial ':' indicating the main namespace are accepted |
int | $defaultNamespace | the namespace to use if none is specified by a prefix |
Wiki pages often contain multiple links to the same page. Title normalization and parsing can become expensive on pages with many links, so we can save a little time by caching them.
In theory these are value objects and won't get changed...
Convert things like é ā or 〗 into real text...
Definition at line 114 of file Title.php.
References $ret, $t, $titleCache, Sanitizer\decodeCharReferences(), and MW_TITLECACHE_MAX.
Referenced by getParentCategoryTree(), isValidMoveTarget(), newFromRedirect(), newMainPage(), and ilWikiUtil\processInternalLinks().
|
static |
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 164 of file Title.php.
References $t.
|
static |
Create a new Title for the Main Page.
Definition at line 266 of file Title.php.
References newFromText().
Title::pageCond | ( | ) |
|
private |
Prefix some arbitrary text with the namespace or interwiki prefix of this object.
string | $name | the text |
Definition at line 1583 of file Title.php.
References getNsText().
Referenced by getPrefixedDBkey(), getPrefixedText(), and getPrefixedURL().
|
static |
Purge expired restrictions from the page_restrictions table.
Definition at line 1448 of file Title.php.
Referenced by getCascadeProtectionSources(), and loadRestrictionsFromRow().
Title::purgeSquid | ( | ) |
Definition at line 1937 of file Title.php.
References getSquidURLs().
Referenced by moveToNewTitle().
Title::quickUserCan | ( | $action | ) |
Can $wgUser perform $action on this page? This skips potentially expensive cascading permission checks.
Suitable for use for nonessential UI controls in common cases, but not for functional access control.
May provide false positives, but should never provide a false negative.
string | $action | action that permission needs to be checked for |
Definition at line 993 of file Title.php.
References userCan().
Title::resetArticleID | ( | $newid | ) |
This clears some fields in this object, and clears any associated keys in the "bad links" section of the link cache.
int | $newid | the new Article ID |
Definition at line 1536 of file Title.php.
References getPrefixedDBkey().
|
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.
Pages with "/./" or "/../" appearing in the URLs will often be unreachable due to the way web browsers deal with 'relative' URLs. Forbid them explicitly.
Magic tilde sequences? Nu-uh!
Limit the size of titles to 255 bytes. This is typically the size of the underlying database field. We make an exception for special pages, which don't need to be stored in the database, and may edge over 255 bytes due to subpage syntax for long titles, e.g. [[Special:Block/Long name]]
Normally, all wiki links are forced to have an initial capital letter so [[foo]] and [[Foo]] point to the same place.
Don't force it for interwikis, since the other site might be case-sensitive.
Can't make a link to a namespace alone... "empty" local links can only be self-links with a fragment identifier.
Definition at line 1604 of file Title.php.
References $mDbkeyform, $mDefaultNamespace, getInterwikiLink(), legalChars(), setFragment(), UTF8_REPLACEMENT, and ilWikiUtil\wfUrlencode().
Title::setFragment | ( | $fragment | ) |
Set the fragment for this title This is kind of bad, since except for this rarely-used function, Title objects are immutable.
The reason this is here is because it's better than setting the members directly, which is what Linker::formatComment was doing previously.
string | $fragment | text |
Definition at line 1796 of file Title.php.
Referenced by secureAndSplit().
Title::touchLinks | ( | ) |
Update page_touched timestamps and send squid purge messages for pages linking to this title.
May be sent to the job queue depending
on the number of links. Typically called on create and delete.
Definition at line 2428 of file Title.php.
References getNamespace().
Title::trackbackRDF | ( | ) |
Definition at line 2459 of file Title.php.
References $title, getFullURL(), getText(), and trackbackURL().
Title::trackbackURL | ( | ) |
Definition at line 2452 of file Title.php.
Referenced by trackbackRDF().
Title::userCan | ( | $action, | |
$doExpensiveQueries = true |
|||
) |
Can $wgUser perform $action on this page?
string | $action | action that permission needs to be checked for |
bool | $doExpensiveQueries | Set this to false to avoid doing unnecessary queries. |
Definition at line 1003 of file Title.php.
References $mNamespace, $result, getCascadeProtectionSources(), getRestrictions(), and isCssJsSubpage().
Referenced by isValidMoveOperation(), quickUserCan(), userCanCreate(), userCanEdit(), and userCanMove().
Title::userCanCreate | ( | $doExpensiveQueries = true | ) |
Can $wgUser create this page?
Definition at line 1112 of file Title.php.
References userCan().
Title::userCanEdit | ( | $doExpensiveQueries = true | ) |
Can $wgUser edit this page?
Definition at line 1103 of file Title.php.
References userCan().
Title::userCanEditCssJsSubpage | ( | ) |
Protect css/js subpages of user pages: can $wgUser edit this page?
Definition at line 1249 of file Title.php.
Title::userCanMove | ( | $doExpensiveQueries = true | ) |
Can $wgUser move this page?
Definition at line 1121 of file Title.php.
References userCan().
Title::userCanRead | ( | ) |
Would anybody with sufficient privileges be able to move this page? Some pages just aren't movable.
Always grant access to the login page. Even anons need to be able to log in.
some pages are explicitly allowed
Definition at line 1141 of file Title.php.
References $result, getNamespace(), getPrefixedText(), and isSpecial().
Title::userIsWatching | ( | ) |
Is $wgUser is watching this page?
Definition at line 968 of file Title.php.
References $mWatched.
|
staticprivate |
Definition at line 35 of file Title.php.
Referenced by getInterwikiCached(), getInterwikiLink(), isLocal(), and isTrans().
Title::$mArticleID |
Definition at line 53 of file Title.php.
Referenced by getArticleID().
Title::$mCascadeRestriction |
Definition at line 56 of file Title.php.
Referenced by areRestrictionsCascading().
Title::$mDbkeyform |
Definition at line 49 of file Title.php.
Referenced by getDBkey(), isAlwaysKnown(), and secureAndSplit().
Title::$mDefaultNamespace |
Definition at line 62 of file Title.php.
Referenced by getDefaultNamespace(), and secureAndSplit().
Title::$mFragment |
Definition at line 52 of file Title.php.
Referenced by getFragment(), and getFullText().
Title::$mInterwiki |
Definition at line 51 of file Title.php.
Referenced by getInterwiki().
Title::$mLatestID |
Definition at line 54 of file Title.php.
Referenced by getLatestRevID().
Title::$mNamespace |
Definition at line 50 of file Title.php.
Referenced by getNamespace(), getNsText(), and userCan().
Title::$mPrefixedText |
Definition at line 61 of file Title.php.
Referenced by getPrefixedText().
|
private |
Title::$mUrlform |
Definition at line 48 of file Title.php.
Referenced by getPartialURL().
Title::$mWatched |
Definition at line 64 of file Title.php.
Referenced by userIsWatching().
|
staticprivate |