3 * Give information about the version of MediaWiki, PHP, the DB and extensions
6 * @subpackage SpecialPage
8 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
9 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
10 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
16 function wfSpecialVersion() {
17 $version = new SpecialVersion
;
21 class SpecialVersion
{
31 function SpecialVersion() {
32 // English motherfucker, do you speak it?
33 $this->langObj
= setupLangObj( 'LanguageEn' );
34 $this->langObj
->initEncoding();
44 $this->MediaWikiCredits() .
45 $this->extensionCredits() .
48 $wgOut->addHTML( $this->IPInfo() );
58 function MediaWikiCredits() {
61 $dbr =& wfGetDB( DB_SLAVE
);
66 This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',
67 copyright (C) 2001-2006 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
68 Tim Starling, Erik Möller, and others.
70 MediaWiki is free software; you can redistribute it and/or modify
71 it under the terms of the GNU General Public License as published by
72 the Free Software Foundation; either version 2 of the License, or
73 (at your option) any later version.
75 MediaWiki is distributed in the hope that it will be useful,
76 but WITHOUT ANY WARRANTY; without even the implied warranty of
77 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78 GNU General Public License for more details.
80 You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU General Public License]
81 along with this program; if not, write to the Free Software
82 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
83 or [http://www.gnu.org/copyleft/gpl.html read it online]
85 * [http://www.mediawiki.org/ MediaWiki]: $wgVersion
86 * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
87 * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion() . "
90 return str_replace( "\t\t", '', $ret );
93 function extensionCredits() {
94 global $wgExtensionCredits, $wgExtensionFunctions, $wgSkinExtensionFunction;
96 if ( ! count( $wgExtensionCredits ) && ! count( $wgExtensionFunctions ) && ! count( $wgSkinExtensionFunction ) )
99 $extensionTypes = array(
100 'specialpage' => 'Special pages',
101 'parserhook' => 'Parser hooks',
102 'variable' => 'Variables',
105 wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
107 $out = "\n* Extensions:\n";
108 foreach ( $extensionTypes as $type => $text ) {
109 if ( count( @$wgExtensionCredits[$type] ) ) {
110 $out .= "** $text:\n";
112 usort( $wgExtensionCredits[$type], array( $this, 'compare' ) );
114 foreach ( $wgExtensionCredits[$type] as $extension ) {
115 wfSuppressWarnings();
116 $out .= $this->formatCredits(
118 $extension['version'],
119 $extension['author'],
121 $extension['description']
128 if ( count( $wgExtensionFunctions ) ) {
129 $out .= "** Extension functions:\n";
130 $out .= '***' . $this->langObj
->listToText( $wgExtensionFunctions ) . "\n";
133 if ( count( $wgSkinExtensionFunction ) ) {
134 $out .= "** Skin extension functions:\n";
135 $out .= '***' . $this->langObj
->listToText( $wgSkinExtensionFunction ) . "\n";
141 function compare( $a, $b ) {
142 if ( $a['name'] === $b['name'] )
145 return $this->langObj
->lc( $a['name'] ) > $this->langObj
->lc( $b['name'] ) ?
1 : -1;
148 function formatCredits( $name, $version = null, $author = null, $url = null, $description = null) {
153 if ( isset( $version ) )
154 $ret .= " (version $version)";
158 if ( isset( $description ) )
159 $ret .= ', ' . $description;
160 if ( isset( $description ) && isset( $author ) )
162 if ( isset( $author ) )
163 $ret .= ' by ' . $this->langObj
->listToText( (array)$author );
171 $myWgHooks = $wgHooks;
175 foreach ($myWgHooks as $hook => $hooks)
176 $ret .= "** $hook:" . $this->langObj
->listToText( $hooks ) . "\n";
185 $ip = str_replace( '--', ' - ', htmlspecialchars( wfGetIP() ) );
186 return "<!-- visited from $ip -->\n";