minor bugsfixed documentation added
[phpmyadmin/ankitg.git] / changelog.php
blobdcdbecf5da7a87429c9cc276e8fe21ed2dd4ffd4
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Simple script to set correct charset for changelog
6 * @version $Id$
7 * @package phpMyAdmin
8 */
10 /**
11 * Load paths.
13 require('./libraries/vendor_config.php');
15 /**
16 * Read changelog.
18 if (substr(CHANGELOG_FILE, -3) == '.gz') {
19 ob_start();
20 readgzfile(CHANGELOG_FILE);
21 $changelog = ob_get_contents();
22 ob_end_clean();
23 } else {
24 $changelog = file_get_contents(CHANGELOG_FILE);
27 /**
28 * Whole changelog in variable.
30 $changelog = htmlspecialchars($changelog);
32 $replaces = array(
33 '@(http://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@'
34 => '<a href="\\1">\\1</a>',
36 // sourceforge users
37 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*)@users.sourceforge.net&gt;/i'
38 => '\\1 <a href="https://sourceforge.net/users/\\3/">\\2</a>',
39 '/thanks to ([^\(\r\n]+) \(([-\w]+)\)/i'
40 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
41 '/thanks to ([^\(\r\n]+) -\s+([-\w]+)/i'
42 => 'thanks to <a href="https://sourceforge.net/users/\\2/">\\1</a>',
44 // mail adresse
45 '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +&lt;(.*@.*)&gt;/i'
46 => '\\1 <a href="mailto:\\3">\\2</a>',
48 // linking patches
49 '/patch\s*#?([0-9]{6,})/i'
50 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">patch #\\1</a>',
52 // linking RFE
53 '/(?:rfe|feature)\s*#?([0-9]{6,})/i'
54 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">RFE #\\1</a>',
56 // linking files
57 '/(\s+)([\\/a-z_0-9\.]+\.(?:php3?|html|pl|js|sh))/i'
58 => '\\1<a href="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/phpmyadmin;a=history;f=\\2;hb=HEAD">\\2</a>',
60 // FAQ entries
61 '/FAQ ([0-9]+)\.([0-9a-z]+)/i'
62 => '<a href="http://localhost/phpMyAdmin/Documentation.html#faq\\1_\\2">FAQ \\1.\\2</a>',
64 // linking bugs
65 '/bug\s*#?([0-9]{6,})/i'
66 => '<a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
68 // all other 6+ digit numbers are treated as bugs
69 '/(?<!BUG|RFE|patch) #?([0-9]{6,})/i'
70 => ' <a href="https://sourceforge.net/support/tracker.php?aid=\\1">bug #\\1</a>',
72 // CVE/CAN entries
73 '/((CAN|CVE)-[0-9]+-[0-9]+)/'
74 => '<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=\\1">\\1</a>',
76 // Highlight releases (with links)
77 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/'
78 => '<a name="\\1_\\2_\\3"></a><a href="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/phpmyadmin;a=shortlog;h=refs/tags/RELEASE_\\1_\\2_\\3">\\1.\\2.\\3.0 \\4</a>',
79 '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/'
80 => '<a name="\\1_\\2_\\3_\\4"></a><a href="http://phpmyadmin.git.sourceforge.net/git/gitweb.cgi?p=phpmyadmin/phpmyadmin;a=shortlog;h=refs/tags/RELEASE_\\1_\\2_\\3_\\4">\\1.\\2.\\3.\\4 \\5</a>',
82 // Highlight releases (not linkable)
83 '/( ### )(.*)/'
84 => '\\1<b>\\2</b>',
88 header('Content-type: text/html; charset=utf-8');
89 echo '<?xml version="1.0" encoding="utf-8"?'.'>';
91 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
92 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
93 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
94 <head>
95 <link rel="icon" href="./favicon.ico" type="image/x-icon" />
96 <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
97 <title>phpMyAdmin - ChangeLog</title>
98 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99 </head>
100 <body>
101 <h1>phpMyAdmin - ChangeLog</h1>
102 <?php
103 echo '<pre>';
104 echo preg_replace(array_keys($replaces), $replaces, $changelog);
105 echo '</pre>';
107 </body>
108 </html>