MediaWiki  1.23.12
InstallDocFormatter.php
Go to the documentation of this file.
1 <?php
24  static function format( $text ) {
25  $obj = new self( $text );
26 
27  return $obj->execute();
28  }
29 
30  protected function __construct( $text ) {
31  $this->text = $text;
32  }
33 
34  protected function execute() {
35  $text = $this->text;
36  // Use Unix line endings, escape some wikitext stuff
37  $text = str_replace( array( '<', '{{', '[[', '__', "\r" ),
38  array( '&lt;', '&#123;&#123;', '&#91;&#91;', '&#95;&#95;', '' ), $text );
39  // join word-wrapped lines into one
40  do {
41  $prev = $text;
42  $text = preg_replace( "/\n([\\*#\t])([^\n]*?)\n([^\n#\\*:]+)/", "\n\\1\\2 \\3", $text );
43  } while ( $text != $prev );
44  // Replace tab indents with colons
45  $text = preg_replace( '/^\t\t/m', '::', $text );
46  $text = preg_replace( '/^\t/m', ':', $text );
47  // turn (bug nnnn) into links
48  $text = preg_replace_callback( '/bug (\d+)/', array( $this, 'replaceBugLinks' ), $text );
49  // add links to manual to every global variable mentioned
50  $text = preg_replace_callback(
51  '/(\$wg[a-z0-9_]+)/i',
52  array( $this, 'replaceConfigLinks' ),
53  $text
54  );
55 
56  return $text;
57  }
58 
59  protected function replaceBugLinks( $matches ) {
60  return '<span class="config-plainlink">[https://bugzilla.wikimedia.org/' .
61  $matches[1] . ' bug ' . $matches[1] . ']</span>';
62  }
63 
64  protected function replaceConfigLinks( $matches ) {
65  return '<span class="config-plainlink">[https://www.mediawiki.org/wiki/Manual:' .
66  $matches[1] . ' ' . $matches[1] . ']</span>';
67  }
68 }
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
text
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition: design.txt:12
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
InstallDocFormatter\format
static format( $text)
Definition: InstallDocFormatter.php:24
$matches
if(!defined( 'MEDIAWIKI')) if(!isset( $wgVersion)) $matches
Definition: NoLocalSettings.php:33
InstallDocFormatter
Definition: InstallDocFormatter.php:23
InstallDocFormatter\__construct
__construct( $text)
Definition: InstallDocFormatter.php:30
InstallDocFormatter\replaceConfigLinks
replaceConfigLinks( $matches)
Definition: InstallDocFormatter.php:64
InstallDocFormatter\replaceBugLinks
replaceBugLinks( $matches)
Definition: InstallDocFormatter.php:59
InstallDocFormatter\execute
execute()
Definition: InstallDocFormatter.php:34