link users, files, bugs, rfes and patches

This commit is contained in:
Sebastian Mendel
2006-04-12 13:15:43 +00:00
parent a5c26c15df
commit 5aa016d32c
2 changed files with 40 additions and 4 deletions

View File

@@ -1,8 +1,42 @@
<?php
// Simple script to set correct charset for changelog
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Simple script to set correct charset for changelog
*
* @id $Id$
* @todo link release tags
*/
header('Content-type: text/plain; charset=utf-8');
readfile('ChangeLog');
$changelog = htmlspecialchars(file_get_contents('ChangeLog'));
$replaces = array(
// sourceforge addresses
'/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+) &lt;(.*)@users.sourceforge.net&gt;/i'
=> '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
// mail adresse
'/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+) &lt;(.*@.*)&gt;/i'
=> '\\1 <a href="mailto:\\3/">\\2</a>',
// linking bugs
'/bug\s+#([0-9]*)/i'
=> '<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=\\1&amp;group_id=23067&amp;atid=377408">bug \\1</a>',
// linking pacthes
'/patch\s+#([0-9]*)/i'
=> '<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=\\1&amp;group_id=23067&amp;atid=377410">patch \\1</a>',
// linking RFE
'/rfe\s+#([0-9]*)/i'
=> '<a href="https://sourceforge.net/tracker/index.php?func=detail&aid=\\1&amp;group_id=23067&amp;atid=377411">RFE \\1</a>',
// linking files
'/(\s+)([\\/a-z_0-9\.]+\.php)/i'
=> '\\1<a href="https://cvs.sourceforge.net/viewcvs.py/phpmyadmin/phpMyAdmin/\\2?annotate=HEAD">\\2</a>',
);
header('Content-type: text/html; charset=utf-8');
echo '<pre>';
echo preg_replace(array_keys($replaces), $replaces, $changelog);
echo '</pre>';
?>