MediaWiki  1.23.12
Preprocessor.php
Go to the documentation of this file.
1 <?php
27 interface Preprocessor {
33  function __construct( $parser );
34 
40  function newFrame();
41 
49  function newCustomFrame( $args );
50 
56  function newPartNodeArray( $values );
57 
66  function preprocessToObj( $text, $flags = 0 );
67 }
68 
72 interface PPFrame {
73  const NO_ARGS = 1;
74  const NO_TEMPLATES = 2;
75  const STRIP_COMMENTS = 4;
76  const NO_IGNORE = 8;
77  const RECOVER_COMMENTS = 16;
78 
79  const RECOVER_ORIG = 27; // = 1|2|8|16 no constant expression support in PHP yet
80 
83 
93  function newChild( $args = false, $title = false, $indexOffset = 0 );
94 
98  function expand( $root, $flags = 0 );
99 
103  function implodeWithFlags( $sep, $flags /*, ... */ );
104 
108  function implode( $sep /*, ... */ );
109 
114  function virtualImplode( $sep /*, ... */ );
115 
119  function virtualBracketedImplode( $start, $sep, $end /*, ... */ );
120 
126  function isEmpty();
127 
131  function getArguments();
132 
136  function getNumberedArguments();
137 
141  function getNamedArguments();
142 
146  function getArgument( $name );
147 
155  function loopCheck( $title );
156 
160  function isTemplate();
161 
167  function getTitle();
168 }
169 
183 interface PPNode {
188  function getChildren();
189 
195  function getFirstChild();
196 
200  function getNextSibling();
201 
206  function getChildrenOfType( $type );
207 
211  function getLength();
212 
216  function item( $i );
217 
230  function getName();
231 
238  function splitArg();
239 
244  function splitExt();
245 
249  function splitHeading();
250 }
PPFrame\isEmpty
isEmpty()
Returns true if there are no arguments in this frame.
PPFrame\getArguments
getArguments()
Returns all arguments of this frame.
PPFrame\loopCheck
loopCheck( $title)
Returns true if the infinite loop check is OK, false if a loop is detected.
PPFrame\getNamedArguments
getNamedArguments()
Returns all named arguments of this frame.
PPNode\item
item( $i)
Returns an item of an array-type node.
PPFrame\STRIP_COMMENTS
const STRIP_COMMENTS
Definition: Preprocessor.php:75
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
Preprocessor\newFrame
newFrame()
Create a new top-level frame for expansion of a page.
PPFrame\NO_ARGS
const NO_ARGS
Definition: Preprocessor.php:73
PPNode\splitArg
splitArg()
Split a "<part>" node into an associative array containing: name PPNode name index String index value...
Preprocessor
Definition: Preprocessor.php:27
Preprocessor\newPartNodeArray
newPartNodeArray( $values)
Create a new custom node for programmatic use of parameter replacement as used in some extensions.
PPFrame\NO_IGNORE
const NO_IGNORE
Definition: Preprocessor.php:76
PPNode\splitExt
splitExt()
Split an "<ext>" node into an associative array containing name, attr, inner and close All values in ...
PPNode\getFirstChild
getFirstChild()
Get the first child of a tree node.
Preprocessor\newCustomFrame
newCustomFrame( $args)
Create a new custom frame for programmatic use of parameter replacement as used in some extensions.
PPFrame\getNumberedArguments
getNumberedArguments()
Returns all numbered arguments of this frame.
PPFrame\implode
implode( $sep)
Implode with no flags specified.
$flags
it s the revision text itself In either if gzip is the revision text is gzipped $flags
Definition: hooks.txt:2118
PPFrame\RECOVER_COMMENTS
const RECOVER_COMMENTS
Definition: Preprocessor.php:77
PPFrame\NO_TEMPLATES
const NO_TEMPLATES
Definition: Preprocessor.php:74
PPFrame\newChild
newChild( $args=false, $title=false, $indexOffset=0)
Create a child frame.
PPNode\getChildren
getChildren()
Get an array-type node containing the children of this node.
PPNode\getLength
getLength()
Returns the length of the array, or false if this is not an array-type node.
Preprocessor\preprocessToObj
preprocessToObj( $text, $flags=0)
Preprocess text to a PPNode.
PPFrame\getTitle
getTitle()
Get a title of frame.
$parser
do that in ParserLimitReportFormat instead $parser
Definition: hooks.txt:1961
PPNode
There are three types of nodes:
Definition: Preprocessor.php:183
PPFrame\RECOVER_ORIG
const RECOVER_ORIG
Definition: Preprocessor.php:79
PPNode\getChildrenOfType
getChildrenOfType( $type)
Get all children of this tree node which have a given name.
PPFrame\implodeWithFlags
implodeWithFlags( $sep, $flags)
Implode with flags for expand()
PPNode\getName
getName()
Get the name of this node.
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
PPFrame\expand
expand( $root, $flags=0)
Expand a document tree node.
PPFrame
Definition: Preprocessor.php:72
$args
if( $line===false) $args
Definition: cdb.php:62
PPFrame\getArgument
getArgument( $name)
Get an argument to this frame by name.
PPFrame\virtualBracketedImplode
virtualBracketedImplode( $start, $sep, $end)
Virtual implode with brackets.
PPFrame\SUPPORTS_INDEX_OFFSET
const SUPPORTS_INDEX_OFFSET
This constant exists when $indexOffset is supported in newChild()
Definition: Preprocessor.php:82
PPFrame\isTemplate
isTemplate()
Return true if the frame is a template frame.
PPNode\getNextSibling
getNextSibling()
Get the next sibling of any node.
PPFrame\virtualImplode
virtualImplode( $sep)
Makes an object that, when expand()ed, will be the same as one obtained with implode()
PPNode\splitHeading
splitHeading()
Split an "<h>" node.
Preprocessor\__construct
__construct( $parser)
Create a new preprocessor object based on an initialised Parser object.
$type
$type
Definition: testCompression.php:46