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
{
30 function SpecialVersion() {
31 // English motherfucker, do you speak it?
32 $this->langObj
= setupLangObj( 'LanguageEn' );
33 $this->langObj
->initEncoding();
39 $wgOut->setRobotpolicy( 'index,follow' );
40 $wgOut->addWikiText( $this->MediaWikiCredits() . $this->extensionCredits() . $this->wgHooks() );
41 $wgOut->addHTML( $this->IPInfo() );
44 function MediaWikiCredits() {
47 $dbr =& wfGetDB( DB_SLAVE
);
52 This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',
53 copyright (C) 2001-2005 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
54 Tim Starling, Erik Möller, and others.
56 MediaWiki is free software; you can redistribute it and/or modify
57 it under the terms of the GNU General Public License as published by
58 the Free Software Foundation; either version 2 of the License, or
59 (at your option) any later version.
61 MediaWiki is distributed in the hope that it will be useful,
62 but WITHOUT ANY WARRANTY; without even the implied warranty of
63 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
64 GNU General Public License for more details.
66 You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU General Public License]
67 along with this program; if not, write to the Free Software
68 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
69 or [http://www.gnu.org/copyleft/gpl.html read it online]
71 * [http://www.mediawiki.org/ MediaWiki]: $wgVersion
72 * [http://www.php.net/ PHP]: " . phpversion() . " (" . php_sapi_name() . ")
73 * " . $dbr->getSoftwareLink() . ": " . $dbr->getServerVersion() . "
76 return str_replace( "\t\t", '', $ret );
79 function extensionCredits() {
80 global $wgExtensionCredits, $wgExtensionFunctions, $wgSkinExtensionFunction;
82 if ( ! count( $wgExtensionCredits ) && ! count( $wgExtensionFunctions ) && ! count( $wgSkinExtensionFunction ) )
85 $extensionTypes = array(
86 'specialpage' => 'Special pages',
87 'parserhook' => 'Parser hooks',
91 wfRunHooks( 'ExtensionTypes', array( &$extensionTypes ) );
93 $out = "\n* Extensions:\n";
94 foreach ( $extensionTypes as $type => $text ) {
95 if ( count( @$wgExtensionCredits[$type] ) ) {
96 $out .= "** $text:\n";
97 foreach ( $wgExtensionCredits[$type] as $extension ) {
99 $out .= $this->formatCredits(
101 $extension['version'],
102 $extension['author'],
104 $extension['description']
111 if ( count( $wgExtensionFunctions ) ) {
112 $out .= "** Extension functions:\n";
113 $out .= '***' . $this->langObj
->listToText( $wgExtensionFunctions ) . "\n";
116 if ( count( $wgSkinExtensionFunction ) ) {
117 $out .= "** Skin extension functions:\n";
118 $out .= '***' . $this->langObj
->listToText( $wgSkinExtensionFunction ) . "\n";
124 function formatCredits( $name, $version = null, $author = null, $url = null, $description = null) {
129 if ( isset( $version ) )
130 $ret .= " (version $version)";
134 if ( isset( $description ) )
135 $ret .= ', ' . $description;
136 if ( isset( $description ) && isset( $author ) )
138 if ( isset( $author ) )
139 $ret .= ' by ' . $this->langObj
->listToText( (array)$author );
141 return htmlspecialchars( $ret ) . "\n";
149 foreach ($wgHooks as $hook => $hooks) {
150 $ret .= "** $hook: " . $this->langObj
->listToText( $hooks ) . "\n";
158 $ip = str_replace( '--', ' - - ', htmlspecialchars( wfGetIP() ) );
159 return "<!-- visited from $ip -->\n";