Index: branches/new-installer/phase3/includes/installer/WebInstaller.php |
— | — | @@ -1594,28 +1594,36 @@ |
1595 | 1595 | function getFileContents() { |
1596 | 1596 | return file_get_contents( dirname( __FILE__ ) . '/../../' . $this->getFileName() ); |
1597 | 1597 | } |
1598 | | -} |
1599 | 1598 | |
1600 | | -class WebInstaller_Readme extends WebInstaller_Document { |
1601 | | - function getFileName() { return 'README'; } |
1602 | | -} |
1603 | | -class WebInstaller_ReleaseNotes extends WebInstaller_Document { |
1604 | | - function getFileName() { return 'RELEASE-NOTES'; } |
1605 | | - function getFileContents() { |
1606 | | - $text = parent::getFileContents(); |
| 1599 | + protected function formatTextFile( $text ) { |
| 1600 | + $text = preg_replace( "/\n\\*([^\r\n]*?)\r?\n[ \t]+/", "\n*\\1 ", $text ); |
1607 | 1601 | $text = preg_replace_callback('/\(bug (\d+)\)/', array( 'WebInstaller_ReleaseNotes', 'replaceBugLinks' ), $text ); |
1608 | 1602 | $text = preg_replace_callback('/(\$wg[a-z0-9_]+)/i', array( 'WebInstaller_ReleaseNotes', 'replaceConfigLinks' ), $text ); |
1609 | 1603 | return $text; |
1610 | 1604 | } |
| 1605 | + |
1611 | 1606 | private static function replaceBugLinks( $matches ) { |
1612 | 1607 | return '(<span class="config-plainlink">[https://bugzilla.wikimedia.org/show_bug.cgi?id=' . |
1613 | | - $matches[1] . ' bug ' . $matches[1] . '])'; |
| 1608 | + $matches[1] . ' bug ' . $matches[1] . ']</span>)'; |
1614 | 1609 | } |
| 1610 | + |
1615 | 1611 | private static function replaceConfigLinks( $matches ) { |
1616 | 1612 | return '<span class="config-plainlink">[http://www.mediawiki.org/wiki/Manual:' . |
1617 | | - $matches[1] . ' ' . $matches[1] . ']'; |
| 1613 | + $matches[1] . ' ' . $matches[1] . ']</span>'; |
1618 | 1614 | } |
1619 | 1615 | } |
| 1616 | + |
| 1617 | +class WebInstaller_Readme extends WebInstaller_Document { |
| 1618 | + function getFileName() { return 'README'; } |
| 1619 | +} |
| 1620 | +class WebInstaller_ReleaseNotes extends WebInstaller_Document { |
| 1621 | + function getFileName() { return 'RELEASE-NOTES'; } |
| 1622 | + |
| 1623 | + function getFileContents() { |
| 1624 | + echo $this->formatTextFile( parent::getFileContents() ); |
| 1625 | + return $this->formatTextFile( parent::getFileContents() ); |
| 1626 | + } |
| 1627 | +} |
1620 | 1628 | class WebInstaller_Copying extends WebInstaller_Document { |
1621 | 1629 | function getFileName() { return 'COPYING'; } |
1622 | 1630 | } |