Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SMW\ContentParser Class Reference

Public Member Functions

 __construct (Title $title, Parser $parser=null)
 
 setParser (Parser $parser)
 
 setRevision (Revision $revision=null)
 
 forceToUseParser ()
 
 getTitle ()
 
 getOutput ()
 
 getErrors ()
 
 skipInTextAnnotationParser ()
 
 parse ( $text=null)
 

Protected Member Functions

 parseText ( $text)
 
 fetchFromContent ()
 
 fetchFromParser ()
 
 msgForNullRevision ( $fname=__METHOD__)
 
 makeParserOptions ()
 
 getRevision ()
 
 hasContentHandler ()
 

Protected Attributes

 $title
 
 $parser = null
 
 $parserOutput = null
 
 $revision = null
 
 $errors = []
 

Detailed Description

Fetches the ParserOutput either by parsing an invoked text component, re-parsing a text revision, or accessing the ContentHandler to generate a ParserOutput object

GNU GPL v2+

Since
1.9
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\ContentParser::__construct ( Title  $title,
Parser  $parser = null 
)
Note
Injecting new Parser() alone will not yield an expected result and doing new Parser( $GLOBALS['wgParserConf'] brings no benefits therefore we stick to the GLOBAL as fallback if no parser is injected.
Since
1.9
Parameters
Title$title
Parser | null$parser

Member Function Documentation

◆ fetchFromContent()

SMW\ContentParser::fetchFromContent ( )
protected
Note
Revision ID must be passed to the parser output to get revision variables correct
If no content is available create an empty object

◆ forceToUseParser()

SMW\ContentParser::forceToUseParser ( )
Bug:
62856 and #212
Since
2.0

◆ getErrors()

SMW\ContentParser::getErrors ( )
Since
1.9
Returns
array

◆ getOutput()

SMW\ContentParser::getOutput ( )
Since
1.9
Returns
ParserOutput|null

◆ getTitle()

SMW\ContentParser::getTitle ( )
Since
1.9
Returns
Title

◆ parse()

SMW\ContentParser::parse (   $text = null)

Generates or fetches the ParserOutput object from an appropriate source

Since
1.9
Parameters
string | null$text
Returns
ContentParser

◆ setParser()

SMW\ContentParser::setParser ( Parser  $parser)
Since
2.3
Returns
Parser $parser

◆ setRevision()

SMW\ContentParser::setRevision ( Revision  $revision = null)
Since
1.9.1
Returns
ContentParser

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

About | General disclaimer | Privacy policy