r63699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63698‎ | r63699 | r63700 >
Date:18:29, 13 March 2010
Author:maxsem
Status:ok (Comments)
Tags:
Comment:
Apply 1337 regexes to README too, rm stray debugging code from r63695
Modified paths:
  • /branches/new-installer/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/includes/installer/WebInstaller.php
@@ -1596,7 +1596,11 @@
15971597 }
15981598
15991599 protected function formatTextFile( $text ) {
1600 - $text = preg_replace( "/\n\\*([^\r\n]*?)\r?\n[ \t]+/", "\n*\\1 ", $text );
 1600+ $text = preg_replace( "/\r?\n(\r?\n)?\\[\\d+\\]/m", "\\1#", $text );
 1601+ do {
 1602+ $prev = $text;
 1603+ $text = preg_replace( "/\n([\\*#])([^\r\n]*?)\r?\n([^\r\n#\\*:]+)/", "\n\\1\\2 \\3", $text );
 1604+ } while ( $text != $prev );
16011605 $text = preg_replace_callback('/\(bug (\d+)\)/', array( 'WebInstaller_ReleaseNotes', 'replaceBugLinks' ), $text );
16021606 $text = preg_replace_callback('/(\$wg[a-z0-9_]+)/i', array( 'WebInstaller_ReleaseNotes', 'replaceConfigLinks' ), $text );
16031607 return $text;
@@ -1615,15 +1619,20 @@
16161620
16171621 class WebInstaller_Readme extends WebInstaller_Document {
16181622 function getFileName() { return 'README'; }
 1623+
 1624+ function getFileContents() {
 1625+ return $this->formatTextFile( parent::getFileContents() );
 1626+ }
16191627 }
 1628+
16201629 class WebInstaller_ReleaseNotes extends WebInstaller_Document {
16211630 function getFileName() { return 'RELEASE-NOTES'; }
16221631
16231632 function getFileContents() {
1624 - echo $this->formatTextFile( parent::getFileContents() );
16251633 return $this->formatTextFile( parent::getFileContents() );
16261634 }
16271635 }
 1636+
16281637 class WebInstaller_Copying extends WebInstaller_Document {
16291638 function getFileName() { return 'COPYING'; }
16301639 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63695new-installer: tweaks and refactoring of RELEASE-NOTES formattermaxsem18:08, 13 March 2010

Comments

#Comment by Simetrical (talk | contribs)   17:57, 16 March 2010

This looks like a good candidate for the /x modifier, so that it might actually become readable.

Status & tagging log