MagicWordArray Class Reference
[Parser]

Class for handling an array of magic words. More...

List of all members.

Public Member Functions

 __construct ($names=array())
 add ($name)
 Add a magic word by name.
 addArray ($names)
 Add a number of magic words by name.
 getHash ()
 Get a 2-d hashtable for this array.
 getBaseRegex ()
 Get the base regex.
 getRegex ()
 Get an unanchored regex.
 getVariableRegex ()
 Get a regex for matching variables.
 getVariableStartToEndRegex ()
 Get an anchored regex for matching variables.
 parseMatch ($m)
 Parse a match array from preg_match Returns array(magic word ID, parameter value) If there is no parameter value, that element will be false.
 matchVariableStartToEnd ($text)
 Match some text, with parameter capture Returns an array with the magic word name in the first element and the parameter in the second element.
 matchStartToEnd ($text)
 Match some text, without parameter capture Returns the magic word name, or false if there was no capture.
 matchAndRemove (&$text)
 Returns an associative array, ID => param value, for all items that match Removes the matched items from the input string (passed by reference).

Public Attributes

 $names = array()
 $hash
 $baseRegex
 $regex
 $matches


Detailed Description

Class for handling an array of magic words.

Definition at line 487 of file MagicWord.php.


Constructor & Destructor Documentation

MagicWordArray::__construct ( names = array()  ) 

Definition at line 493 of file MagicWord.php.

References $names.


Member Function Documentation

MagicWordArray::add ( name  ) 

Add a magic word by name.

Definition at line 500 of file MagicWord.php.

References $name, and $wgContLang.

MagicWordArray::addArray ( names  ) 

Add a number of magic words by name.

Definition at line 509 of file MagicWord.php.

References $names.

MagicWordArray::getBaseRegex (  ) 

Get the base regex.

Definition at line 538 of file MagicWord.php.

References $i, $name, and MagicWord::get().

Referenced by getRegex(), and getVariableStartToEndRegex().

MagicWordArray::getHash (  ) 

Get a 2-d hashtable for this array.

Definition at line 517 of file MagicWord.php.

References $name, $wgContLang, and MagicWord::get().

Referenced by matchStartToEnd().

MagicWordArray::getRegex (  ) 

Get an unanchored regex.

Definition at line 560 of file MagicWord.php.

References getBaseRegex().

Referenced by getVariableRegex(), and matchAndRemove().

MagicWordArray::getVariableRegex (  ) 

Get a regex for matching variables.

Definition at line 577 of file MagicWord.php.

References getRegex().

MagicWordArray::getVariableStartToEndRegex (  ) 

Get an anchored regex for matching variables.

Definition at line 584 of file MagicWord.php.

References getBaseRegex().

Referenced by matchVariableStartToEnd().

MagicWordArray::matchAndRemove ( &$  text  ) 

Returns an associative array, ID => param value, for all items that match Removes the matched items from the input string (passed by reference).

Definition at line 663 of file MagicWord.php.

References $matches, $name, $regex, $text, getRegex(), and parseMatch().

MagicWordArray::matchStartToEnd ( text  ) 

Match some text, without parameter capture Returns the magic word name, or false if there was no capture.

Definition at line 646 of file MagicWord.php.

References $hash, $text, $wgContLang, and getHash().

MagicWordArray::matchVariableStartToEnd ( text  ) 

Match some text, with parameter capture Returns an array with the magic word name in the first element and the parameter in the second element.

Both elements are false if there was no match.

Definition at line 628 of file MagicWord.php.

References $regex, $text, $wgContLang, getVariableStartToEndRegex(), and parseMatch().

MagicWordArray::parseMatch ( m  ) 

Parse a match array from preg_match Returns array(magic word ID, parameter value) If there is no parameter value, that element will be false.

Definition at line 601 of file MagicWord.php.

References $key.

Referenced by matchAndRemove(), and matchVariableStartToEnd().


Member Data Documentation

MagicWordArray::$baseRegex

Definition at line 490 of file MagicWord.php.

MagicWordArray::$hash

Definition at line 489 of file MagicWord.php.

Referenced by matchStartToEnd().

MagicWordArray::$matches

Definition at line 491 of file MagicWord.php.

Referenced by matchAndRemove().

MagicWordArray::$names = array()

Definition at line 488 of file MagicWord.php.

Referenced by __construct(), and addArray().

MagicWordArray::$regex

Definition at line 490 of file MagicWord.php.

Referenced by matchAndRemove(), and matchVariableStartToEnd().


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:42 2009 for MediaWiki by  doxygen 1.5.9