MediaWiki  REL1_19
MWTidy Class Reference

Class to interact with HTML tidy. More...

List of all members.

Static Public Member Functions

static checkErrors ($text, &$errorStr=null)
 Check HTML for errors, used if $wgValidateAllHtml = true.
static tidy ($text)
 Interface with html tidy, used if $wgUseTidy = true.

Static Private Member Functions

static execExternalTidy ($text, $stderr=false, &$retval=null)
 Spawn an external HTML tidy process and get corrected markup back from it.
static execInternalTidy ($text, $stderr=false, &$retval=null)
 Use the HTML tidy extension to use the tidy library in-process, saving the overhead of spawning a new process.

Detailed Description

Class to interact with HTML tidy.

Either the external tidy program or the in-process tidy extension will be used depending on availability. Override the default $wgTidyInternal setting to disable the internal if it's not working.

Definition at line 85 of file Tidy.php.


Member Function Documentation

static MWTidy::checkErrors ( text,
&$  errorStr = null 
) [static]

Check HTML for errors, used if $wgValidateAllHtml = true.

Parameters:
$textString
&$errorStrString: return the error string
Returns:
Boolean: whether the HTML is valid

Definition at line 127 of file Tidy.php.

References $wgTidyInternal, execExternalTidy(), and execInternalTidy().

Referenced by wfHtmlValidationHandler().

Here is the call graph for this function:

Here is the caller graph for this function:

static MWTidy::execExternalTidy ( text,
stderr = false,
&$  retval = null 
) [static, private]

Spawn an external HTML tidy process and get corrected markup back from it.

Also called in OutputHandler.php for full page validation

Parameters:
$textString: HTML to check
$stderrBoolean: Whether to read result from STDERR rather than STDOUT
&$retvalExit code (-1 on internal error)
Returns:
mixed String or null

Definition at line 149 of file Tidy.php.

References $wgTidyBin, $wgTidyConf, $wgTidyOpts, wfGetNull(), wfProfileIn(), wfProfileOut(), and wfWarn().

Referenced by checkErrors(), and tidy().

Here is the call graph for this function:

Here is the caller graph for this function:

static MWTidy::execInternalTidy ( text,
stderr = false,
&$  retval = null 
) [static, private]

Use the HTML tidy extension to use the tidy library in-process, saving the overhead of spawning a new process.

Parameters:
$textString: HTML to check
$stderrBoolean: Whether to read result from error status instead of output
&$retvalExit code (-1 on internal error)
Returns:
mixed String or null

Definition at line 213 of file Tidy.php.

References $wgDebugTidy, $wgTidyConf, MWInit\classExists(), tidy(), wfProfileIn(), wfProfileOut(), and wfWarn().

Referenced by checkErrors(), and tidy().

Here is the call graph for this function:

Here is the caller graph for this function:

static MWTidy::tidy ( text) [static]

Interface with html tidy, used if $wgUseTidy = true.

If tidy isn't able to correct the markup, the original will be returned in all its glory with a warning comment appended.

Parameters:
$textString: hideous HTML input
Returns:
String: corrected HTML output

Definition at line 94 of file Tidy.php.

References $wgTidyInternal, execExternalTidy(), execInternalTidy(), MWTidyWrapper\getWrapped(), and wfDebug().

Referenced by execInternalTidy(), and Parser\parse().

Here is the call graph for this function:

Here is the caller graph for this function:


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