'numberoffiles',
'numberofedits',
'articlepath',
+ 'pageid',
'sitename',
'server',
'servername',
* @return MagicWord
*/
static function &get( $id ) {
- wfProfileIn( __METHOD__ );
if ( !isset( self::$mObjects[$id] ) ) {
$mw = new MagicWord();
$mw->load( $id );
self::$mObjects[$id] = $mw;
}
- wfProfileOut( __METHOD__ );
return self::$mObjects[$id];
}
/**
* Get an array of parser substitution modifier IDs
+ * @return array
*/
static function getSubstIDs() {
- return self::$mSubstIDs;
+ return self::$mSubstIDs;
}
/**
* Allow external reads of TTL array
*
+ * @param $id int
* @return array
*/
- static function getCacheTTL($id) {
+ static function getCacheTTL( $id ) {
if ( array_key_exists( $id, self::$mCacheTTLs ) ) {
return self::$mCacheTTLs[$id];
} else {
*/
function load( $id ) {
global $wgContLang;
+ wfProfileIn( __METHOD__ );
$this->mId = $id;
$wgContLang->getMagic( $this );
if ( !$this->mSynonyms ) {
#throw new MWException( "Error: invalid magic word '$id'" );
wfDebugLog( 'exception', "Error: invalid magic word '$id'\n" );
}
+ wfProfileOut( __METHOD__ );
}
/**
}
/**
- * A comparison function that returns -1, 0 or 1 depending on whether the
- * first string is longer, the same length or shorter than the second
+ * A comparison function that returns -1, 0 or 1 depending on whether the
+ * first string is longer, the same length or shorter than the second
* string.
*
* @param $s1 string
/**
* Returns true if the text contains the word
*
- * @paran $text string
+ * @param $text string
*
* @return bool
*/
/**
* Add a number of magic words by name
*
- * $param $names array
+ * @param $names array
*/
public function addArray( $names ) {
$this->names = array_merge( $this->names, array_values( $names ) );
/**
* Get a regex anchored to the start of the string that does not match parameters
*
- * @return string
+ * @return array
*/
function getRegexStart() {
$base = $this->getBaseRegex();
$newRegex[0] = "/^(?:{$base[0]})/iuS";
}
if ( $base[1] !== '' ) {
- $newRegex[1] = "/^(?:{$base[1]})/S";
+ $newRegex[1] = "/^(?:{$base[1]})/S";
}
return $newRegex;
}
/**
* Get an anchored regex for matching variables with parameters
*
- * @return string
+ * @return array
*/
function getVariableStartToEndRegex() {
$base = $this->getBaseRegex();
* Returns array(magic word ID, parameter value)
* If there is no parameter value, that element will be false.
*
- * @param $m arrray
+ * @param $m array
*
* @return array
*/