Go to the documentation of this file.
63 'processing_instruction_handler' =>
'',
79 $this->filterCallback = $filterCallback;
80 $this->parserOptions = array_merge( $this->parserOptions,
$options );
101 return new self(
$fname, $filterCallback,
true );
116 return new self( $string, $filterCallback,
false );
134 $parser = xml_parser_create_ns(
'UTF-8' );
136 xml_parser_set_option(
$parser, XML_OPTION_CASE_FOLDING,
false );
137 xml_set_element_handler(
$parser,
array( $this,
'rootElementOpen' ),
false );
138 if ( $this->parserOptions[
'processing_instruction_handler'] ) {
139 xml_set_processing_instruction_handler(
141 array( $this,
'processingInstructionHandler' )
153 if ( file_exists(
$fname ) ) {
157 $chunk = fread(
$file, 32768 );
160 $this->wellFormed =
false;
165 }
while ( !feof(
$file ) );
170 $this->wellFormed =
true;
184 $this->wellFormed =
false;
187 $this->wellFormed =
true;
196 $this->rootElement =
$name;
198 if ( is_callable( $this->filterCallback ) ) {
199 xml_set_element_handler(
201 array( $this,
'elementOpen' ),
202 array( $this,
'elementClose' )
204 xml_set_character_data_handler(
$parser,
array( $this,
'elementData' ) );
208 xml_set_element_handler(
$parser,
false,
false );
233 $this->filterCallback,
239 $this->filterMatch =
true;
250 $this->
elementData[ $this->stackDepth - 1 ] .= trim( $data );
259 if ( call_user_func( $this->parserOptions[
'processing_instruction_handler'], $target, $data ) ) {
261 $this->filterMatch =
true;
getParser()
Get an XML parser with the root element handler.
$filterMatch
Will be set to true if the optional element filter returned a match at some point.
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
static newFromString( $string, $filterCallback=null)
Alternative constructor: from string.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
__construct( $input, $filterCallback=null, $isFile=true, $options=array())
if(!defined( 'MEDIAWIKI')) $fname
This file is not a valid entry point, perform no further processing unless MEDIAWIKI is defined.
static newFromFilename( $fname, $filterCallback=null)
Alternative constructor: from filename.
$rootElement
Name of the document's root element, including any namespace as an expanded URL.
elementOpen( $parser, $name, $attribs)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
$elementData
A stack of strings containing the data of each xml element as it's processed.
$elementDataContext
A stack of element names and attributes, as we process them.
$wellFormed
Will be set to true or false to indicate whether the file is well-formed XML.
do that in ParserLimitReportFormat instead $parser
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
processing should stop and the error should be shown to the user * false
$parserOptions
Additional parsing options.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
$stackDepth
Current depth of the data stack.
processingInstructionHandler( $parser, $target, $data)
Allows to change the fields on the form that will be generated $name
validateFromString( $string)
elementData( $parser, $data)
getRootElement()
Get the root element.
validateFromFile( $fname)
if(PHP_SAPI !='cli') $file
elementClose( $parser, $name)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
rootElementOpen( $parser, $name, $attribs)