Cleanup some docs (includes/[s-z])
[lhc/web/wiklou.git] / includes / specials / SpecialVersion.php
index 543c8fe..8ca9e23 100644 (file)
@@ -129,6 +129,7 @@ class SpecialVersion extends SpecialPage {
                                        $this->getEntryPointInfo()
                                );
                                $out->addHtml(
+                                       $this->getSkinCredits() .
                                        $this->getExtensionCredits() .
                                        $this->getParserTags() .
                                        $this->getParserFunctionHooks()
@@ -210,7 +211,9 @@ class SpecialVersion extends SpecialPage {
                // wikimarkup can be used.
                $software = array();
                $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
-               $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . PHP_SAPI . ")";
+               $phpKey = wfIsHHVM() ? '[http://hhvm.com/ HHVM]' :
+                       '[http://www.php.net/ PHP]';
+               $software[$phpKey] = PHP_VERSION . " (" . PHP_SAPI . ")";
                $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
 
                // Allow a hook to add/remove items.
@@ -304,7 +307,7 @@ class SpecialVersion extends SpecialPage {
        }
 
        /**
-        * @return string wgVersion + a link to subversion revision of svn BASE
+        * @return string Global wgVersion + a link to subversion revision of svn BASE
         */
        private static function getVersionLinkedSvn() {
                global $IP;
@@ -346,7 +349,7 @@ class SpecialVersion extends SpecialPage {
 
        /**
         * @since 1.22 Returns the HEAD date in addition to the sha1 and link
-        * @return bool|string wgVersion + HEAD sha1 stripped to the first 7 chars
+        * @return bool|string Global wgVersion + HEAD sha1 stripped to the first 7 chars
         *   with link and date, or false on failure
         */
        private static function getVersionLinkedGit() {
@@ -418,7 +421,7 @@ class SpecialVersion extends SpecialPage {
        }
 
        /**
-        * Generate wikitext showing extensions name, URL, author and description.
+        * Generate wikitext showing the name, URL, author and description of each extension.
         *
         * @return string Wikitext
         */
@@ -450,9 +453,11 @@ class SpecialVersion extends SpecialPage {
                        }
                }
 
+               $this->firstExtOpened = false;
                // Loop through the extension categories to display their extensions in the list.
                foreach ( $extensionTypes as $type => $message ) {
-                       if ( $type != 'other' ) {
+                       // Skins have a separate section
+                       if ( $type !== 'other' && $type !== 'skin' ) {
                                $out .= $this->getExtensionCategory( $type, $message );
                        }
                }
@@ -465,6 +470,27 @@ class SpecialVersion extends SpecialPage {
                return $out;
        }
 
+       /**
+        * Generate wikitext showing the name, URL, author and description of each skin.
+        *
+        * @return string Wikitext
+        */
+       function getSkinCredits() {
+               $out = Xml::element(
+                               'h2',
+                               array( 'id' => 'mw-version-skin' ),
+                               $this->msg( 'version-skins' )->text()
+                       ) .
+                       Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-skin' ) );
+
+               $this->firstExtOpened = false;
+               $out .= $this->getExtensionCategory( 'skin', null );
+
+               $out .= Xml::closeElement( 'table' );
+
+               return $out;
+       }
+
        /**
         * Obtains a list of installed parser tags and the associated H2 header
         *
@@ -487,7 +513,7 @@ class SpecialVersion extends SpecialPage {
                        );
 
                        array_walk( $tags, function ( &$value ) {
-                               $value = '<' . htmlentities( $value ) . '>';
+                               $value = '<' . htmlspecialchars( $value ) . '>';
                        } );
                        $out .= $this->listToText( $tags );
                } else {
@@ -624,6 +650,7 @@ class SpecialVersion extends SpecialPage {
 
                if ( isset( $extension['path'] ) ) {
                        global $IP;
+                       $extensionPath = dirname( $extension['path'] );
                        if ( $this->coreId == '' ) {
                                wfDebug( 'Looking up core head id' );
                                $coreHeadSHA1 = self::getGitHeadSha1( $IP );
@@ -642,7 +669,6 @@ class SpecialVersion extends SpecialPage {
 
                        if ( !$vcsVersion ) {
                                wfDebug( "Getting VCS info for extension $extensionName" );
-                               $extensionPath = dirname( $extension['path'] );
                                $gitInfo = new GitInfo( $extensionPath );
                                $vcsVersion = $gitInfo->getHeadSHA1();
                                if ( $vcsVersion !== false ) {
@@ -795,7 +821,7 @@ class SpecialVersion extends SpecialPage {
                }
        }
 
-       private function openExtType( $text, $name = null ) {
+       private function openExtType( $text = null, $name = null ) {
                $out = '';
 
                $opt = array( 'colspan' => 5 );
@@ -811,13 +837,18 @@ class SpecialVersion extends SpecialPage {
                        $opt['id'] = "sv-$name";
                }
 
-               $out .= Html::rawElement( 'tr', array(),
-                       Html::element( 'th', $opt, $text )
-               );
+               if ( $text !== null ) {
+                       $out .= Html::rawElement( 'tr', array(),
+                               Html::element( 'th', $opt, $text )
+                       );
+               }
 
+               $firstHeadingMsg = ( $name === 'credits-skin' )
+                       ? 'version-skin-colheader-name'
+                       : 'version-ext-colheader-name';
                $out .= Html::openElement( 'tr' );
                $out .= Html::element( 'th', array( 'class' => 'mw-version-ext-col-label' ),
-                       $this->msg( 'version-ext-colheader-name' )->text() );
+                       $this->msg( $firstHeadingMsg )->text() );
                $out .= Html::element( 'th', array( 'class' => 'mw-version-ext-col-label' ),
                        $this->msg( 'version-ext-colheader-version' )->text() );
                $out .= Html::element( 'th', array( 'class' => 'mw-version-ext-col-label' ),