fix up to add the local bin path, link to r52527 and r52525 for CodeReview if any...
authorShinjiman <shinjiman@users.mediawiki.org>
Mon, 29 Jun 2009 15:35:18 +0000 (15:35 +0000)
committerShinjiman <shinjiman@users.mediawiki.org>
Mon, 29 Jun 2009 15:35:18 +0000 (15:35 +0000)
includes/specials/SpecialVersion.php

index d54b620..a4b6dbd 100644 (file)
@@ -203,6 +203,7 @@ class SpecialVersion extends SpecialPage {
                // Look for TeX support and print the software version info
                if ( $wgUseTeX ) {
                        $binPath = '/usr/bin/';
+                       $binPathLocal = '/usr/local/bin/'; 
                        $swMathName = Array(
                                'ocaml'       => 'OCaml',
                                'gs'          => 'Ghostscript',
@@ -232,9 +233,9 @@ class SpecialVersion extends SpecialPage {
                                'imagemagick' => '-version',
                        );
                        foreach ( $swMathExec as $swMath => $swMathCmd ) {
-                               if ( file_exists( $binPath . $swMathCmd ) ) {
-                                       $swMathInfo = self::execOutput( $binPath . $swMathCmd . ' ' . $swMathParam[$swMath] );
-                                       $swMathLine = explode("\n",$swMathInfo ,2);
+                               if ( file_exists( $binPath . $swMathCmd ) || file_exists( $binPathLocal . $swMathCmd ) ) {
+                                       $swMathInfo = self::execOutput( $swMathCmd . ' ' . $swMathParam[$swMath] );
+                                       $swMathLine = explode( "\n", $swMathInfo, 2);
                                        $swMathVerInfo = $swMathLine[0];
                                        if ( !strcmp( $swMath, 'gs' ) )
                                                $swMathVerInfo = str_replace( 'GPL Ghostscript ', '', $swMathVerInfo );
@@ -246,7 +247,7 @@ class SpecialVersion extends SpecialPage {
                                                list( $swMathVerInfo ) = explode('http://www.imagemagick.org', $tail );
                                        }
                                        $swMathVer[$swMath] = $swMathVerInfo;
-                                       $software["[$swMathURL[$swMath] $swMathName[$swMath]]"] = $swMathVer[$swMath];
+                                       $software["[$swMathURL[$swMath] $swMathName[$swMath]]"] = trim ( $swMathVer[$swMath] );
                                }       
                        }
                }