r52476 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52475‎ | r52476 | r52477 >
Date:21:58, 26 June 2009
Author:shinjiman
Status:reverted (Comments)
Tags:
Comment:
* (bug 14611) Added support showing the version of the image thumbnailing engine.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -43,6 +43,18 @@
4444 $wgOut->addHTML( '</div>' );
4545 }
4646
 47+ /**
 48+ * execuate command for output
 49+ * @param string command
 50+ * @return string output
 51+ */
 52+ function execOutput( $cmd ) {
 53+ $out = array( $cmd );
 54+ exec( $cmd.' 2>&1', $out );
 55+ unset($out[0]);
 56+ return implode("\n", $out );
 57+ }
 58+
4759 /**#@+
4860 * @private
4961 */
@@ -88,6 +100,7 @@
89101 * @return wiki text showing the third party software versions (apache, php, mysql).
90102 */
91103 static function softwareInformation() {
 104+ global $wgUseImageMagick, $wgImageMagickConvertCommand;
92105 $dbr = wfGetDB( DB_SLAVE );
93106
94107 // Put the software in an array of form 'name' => 'version'. All messages should
@@ -98,6 +111,27 @@
99112 $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")";
100113 $software[$dbr->getSoftwareLink()] = $dbr->getServerVersion();
101114
 115+ // Look for ImageMagick's version, if did not found, try to find the GD library version
 116+ if ( $wgUseImageMagick === true ) {
 117+ if ( file_exists( $wgImageMagickConvertCommand ) ) {
 118+ $swImageMagickInfo = self::execOutput( $wgImageMagickConvertCommand . ' -version' );
 119+ list( $head, $tail ) = explode( 'ImageMagick', $swImageMagickInfo );
 120+ list( $swImageMagickVer ) = explode('http://www.imagemagick.org', $tail );
 121+ $software['[http://www.imagemagick.org/ ImageMagick]'] = $swImageMagickVer;
 122+ }
 123+ } else {
 124+ if( function_exists( 'gd_info' ) ) {
 125+ $gdInfo = gd_info();
 126+ if ( strstr( $gdInfo['GD Version'], 'bundled' ) !== '' ) {
 127+ $gd_URL = 'http://www.php.net/gd';
 128+ }
 129+ else {
 130+ $gd_URL = 'http://www.libgd.org';
 131+ }
 132+ $software['[' . $gd_URL . ' GD library]'] = $gdInfo['GD Version'];
 133+ }
 134+ }
 135+
102136 // Allow a hook to add/remove items
103137 wfRunHooks( 'SoftwareInfo', array( &$software ) );
104138
Index: trunk/phase3/RELEASE-NOTES
@@ -91,8 +91,9 @@
9292 stripped from them.
9393 * Added a PHP port of CDB (constant database), for improved local caching when
9494 the DBA extension is not available.
 95+* (bug 14611) Added support showing the version of the image thumbnailing
 96+ engine.
9597
96 -
9798 === Bug fixes in 1.16 ===
9899
99100 * (bug 18031) Make namespace selector on Special:Export remember the previous

Follow-up revisions

RevisionCommit summaryAuthorDate
r52480fix for r52476, include the cases with quotation marks.shinjiman09:01, 27 June 2009
r52486* (bug 14611) Added support showing the version of the diff/diff3 engine.shinjiman10:40, 27 June 2009
r52487fix regression in r52476, point to the correct GD library home page or PHP GD...shinjiman11:52, 27 June 2009
r52516* (bug 14611) Added support showing the version of the SVG image thumbnailing...shinjiman16:25, 28 June 2009
r52525* (bug 14611) Added support showing the version of the Math rendering engine.shinjiman18:42, 28 June 2009
r52792* (bug 14611) Added support showing the version of the web server which it is...shinjiman12:08, 6 July 2009
r53398* (bug 14611) Add a global variable hook to show the extended software inform...shinjiman14:49, 17 July 2009

Comments

#Comment by Raymond (talk | contribs)   11:11, 27 June 2009

Seen at translatewiki.net:

PHP Strict Standards: Non-static method SpecialVersion::execOutput() should not be called statically in /var/www/w/includes/specials/SpecialVersion.php on line 116

#Comment by Shinjiman (talk | contribs)   16:16, 27 June 2009

Fixed in r52488 by iAlex using the static keyword to avoid E_STRICT.

Status & tagging log