Go to the documentation of this file.
46 public static function tidy( $text ) {
50 ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
52 return $driver->tidy( $text );
63 public static function checkErrors( $text, &$errorStr =
null ) {
67 ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
69 if ( $driver->supportsValidate() ) {
70 return $driver->validate( $text, $errorStr );
72 throw new MWException( __METHOD__ .
": error text return from HHVM tidy is not supported" );
90 if ( self::$instance ===
null ) {
102 $config[
'driver'] =
'RaggettInternalHHVM';
104 $config[
'driver'] =
'RaggettInternalPHP';
107 $config[
'driver'] =
'RaggettExternal';
125 switch ( $config[
'driver'] ) {
126 case 'RaggettInternalHHVM':
129 case 'RaggettInternalPHP':
132 case 'RaggettExternal':
135 case 'Html5Depurate':
138 case 'Html5Internal':
147 throw new MWException(
"Invalid tidy driver: \"{$config['driver']}\"" );
164 self::$instance =
null;
static factory(array $config)
Create a new Tidy driver object from configuration.
$wgDebugTidy
Put tidy warnings in HTML comments Only works for internal tidy.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Class to interact with HTML tidy.
when a variable name is used in a it is silently declared as a new masking the global
static setInstance( $instance)
Set the driver to be used.
$wgTidyConf
The path to the tidy config file.
$wgTidyInternal
Set this to true to use the tidy extension.
$wgUseTidy
Set this to true to use the deprecated tidy configuration parameters.
$wgTidyOpts
The command line options to the tidy binary.
$wgTidyConfig
Configuration for HTML postprocessing tool.
static checkErrors( $text, &$errorStr=null)
Check HTML for errors, used if $wgValidateAllHtml = true.
$wgTidyBin
The path to the tidy binary.
wfIsHHVM()
Check if we are running under HHVM.
static destroySingleton()
Destroy the current singleton instance.
the array() calling protocol came about after MediaWiki 1.4rc1.
static tidy( $text)
Interface with html tidy.