ILIAS
trunk Revision v11.0_alpha-1866-gfa368f7776e
|
Public Member Functions | |
__construct () | |
#- More... | |
getText () | |
Simple accessors. More... | |
getDBkey () | |
Get the main part with underscores. More... | |
getNamespace () | |
Get the namespace index, i.e. More... | |
getNsText () | |
Get the namespace text. More... | |
getInterwiki () | |
Get the interwiki prefix (or null string) More... | |
getFragment () | |
Get the Title fragment (i.e. More... | |
prefix ($name) | |
Prefix some arbitrary text with the namespace or interwiki prefix of this object. More... | |
setFragment ($fragment) | |
Set the fragment for this title This is kind of bad, since except for this rarely-used function, Title objects are immutable. More... | |
equals ($title) | |
Compare with another title. More... | |
Static Public Member Functions | |
static | newFromText ($text, $defaultNamespace=NS_MAIN) |
Create a new Title from text, such as what one would find in a link. More... | |
static | legalChars () |
Get a regex character class describing the legal characters in a link. More... | |
getInterwikiLink ($key) | |
Returns the URL associated with an interwiki prefix. More... | |
Data Fields | |
$mTextform | |
All member variables should be considered private Please use the accessor functions. More... | |
$mUrlform | |
$mDbkeyform | |
$mNamespace | |
$mInterwiki | |
$mFragment | |
$mArticleID | |
$mLatestID | |
$mRestrictions | |
$mCascadeRestriction | |
$mRestrictionsExpiry | |
$mHasCascadingRestrictions | |
$mCascadeRestrictionSources | |
$mRestrictionsLoaded | |
$mPrefixedText | |
$mDefaultNamespace | |
$mWatched | |
Protected Attributes | |
bool | $mOldRestrictions |
Private Member Functions | |
secureAndSplit () | |
Secure and split - main initialisation function for this object. More... | |
Static Private Attributes | |
static | $titleCache = array() |
Static cache variables. More... | |
static | $interwikiCache = array() |
Title class.
Title::__construct | ( | ) |
#-
Constructor
Definition at line 87 of file Title.php.
Title::equals | ( | $title | ) |
Compare with another title.
Title | $title |
Definition at line 488 of file Title.php.
References getDBkey(), getInterwiki(), and getNamespace().
Title::getDBkey | ( | ) |
Get the main part with underscores.
Definition at line 206 of file Title.php.
References $mDbkeyform.
Referenced by equals().
Title::getFragment | ( | ) |
Get the Title fragment (i.e.
the bit after the #) in text form
Definition at line 251 of file Title.php.
References $mFragment.
Title::getInterwiki | ( | ) |
Get the interwiki prefix (or null string)
Definition at line 243 of file Title.php.
References $mInterwiki.
Referenced by equals().
|
static |
Returns the URL associated with an interwiki prefix.
string | $key | the interwiki prefix (e.g. "MeatBall") |
Definition at line 183 of file Title.php.
Referenced by secureAndSplit().
Title::getNamespace | ( | ) |
Get the namespace index, i.e.
one of the NS_xxxx constants
Definition at line 214 of file Title.php.
References $mNamespace.
Referenced by equals().
Title::getNsText | ( | ) |
Get the namespace text.
Definition at line 222 of file Title.php.
References $mNamespace.
Referenced by prefix().
Title::getText | ( | ) |
Simple accessors.
Get the text form (spaces not underscores) of the main part
Definition at line 197 of file Title.php.
References $mTextform.
|
static |
Get a regex character class describing the legal characters in a link.
Definition at line 166 of file Title.php.
Referenced by secureAndSplit().
|
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 115 of file Title.php.
References $titleCache, Sanitizer\decodeCharReferences(), MW_TITLECACHE_MAX, NS_MAIN, and null.
Referenced by ilWikiUtil\processInternalLinks().
Title::prefix | ( | $name | ) |
Prefix some arbitrary text with the namespace or interwiki prefix of this object.
string | $name | the text |
Definition at line 264 of file Title.php.
References getNsText().
|
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 286 of file Title.php.
References $mDbkeyform, $mDefaultNamespace, getInterwikiLink(), legalChars(), NS_MAIN, NS_SPECIAL, setFragment(), 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 477 of file Title.php.
Referenced by secureAndSplit().
Title::$mDbkeyform |
Definition at line 64 of file Title.php.
Referenced by getDBkey(), and secureAndSplit().
Title::$mDefaultNamespace |
Definition at line 77 of file Title.php.
Referenced by secureAndSplit().
Title::$mFragment |
Definition at line 67 of file Title.php.
Referenced by getFragment().
Title::$mInterwiki |
Definition at line 66 of file Title.php.
Referenced by getInterwiki().
Title::$mNamespace |
Definition at line 65 of file Title.php.
Referenced by getNamespace(), and getNsText().
Title::$mTextform |
|
staticprivate |