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