* GROUP BY support in makeSelectOptions()
[lhc/web/wiklou.git] / includes / SpecialVersion.php
1 <?php
2 /**
3 * Give information about the version MediaWiki, PHP, and the database
4 *
5 * @package MediaWiki
6 * @subpackage SpecialPage
7 */
8
9 /**
10 * constructor
11 */
12 function wfSpecialVersion() {
13 global $wgOut, $wgVersion, $wgExtensionCredits;
14
15 $dbr =& wfGetDB( DB_SLAVE );
16
17 $out = "
18 <div dir='ltr'>
19 This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',
20 copyright (C) 2001-2005 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
21 Tim Starling, Erik Möller, and others.
22
23 MediaWiki is free software; you can redistribute it and/or modify
24 it under the terms of the GNU General Public License as published by
25 the Free Software Foundation; either version 2 of the License, or
26 (at your option) any later version.
27
28 MediaWiki is distributed in the hope that it will be useful,
29 but WITHOUT ANY WARRANTY; without even the implied warranty of
30 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 GNU General Public License for more details.
32
33 You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU General Public License]
34 along with this program; if not, write to the Free Software
35 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 or [http://www.gnu.org/copyleft/gpl.html read it online]
37
38 * [http://www.mediawiki.org/ MediaWiki]: $wgVersion
39 * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
40 * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion() . "
41 </div>
42 ";
43 if ( count( $wgExtensionCredits ) > 0 ) {
44 $extensionTypes = array(
45 'specialpage' => 'Special pages',
46 'parserhook' => 'Parser hooks',
47 'other' => 'Other'
48 );
49
50 $out .= "== Extensions ==\n";
51
52 foreach ( $extensionTypes as $type => $text ) {
53 if ( count( @$wgExtensionCredits[$type] ) > 0 ) {
54 $out .= "=== $text ===\n";
55 foreach ( $wgExtensionCredits[$type] as $extension ) {
56 $out .= formatExtensionCredits( $extension['name'], $extension['author'], @$extension['url'], @$extension['version'] );
57 }
58 }
59
60 }
61 }
62 $wgOut->addWikiText( $out );
63 }
64
65 function formatExtensionCredits( $name, $author, $url = null, $version = null ) {
66 $ret = '* ';
67 if ( isset( $url ) )
68 $ret .= "[$url ";
69 $ret .= $name;
70 if ( isset( $url ) )
71 $ret .= ']';
72 if ( isset( $version ) )
73 $ret .= " $version";
74 $ret .= " by $author\n";
75 return $ret;
76 }
77 ?>