Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -203,7 +203,6 @@ |
204 | 204 | // Look for TeX support and print the software version info |
205 | 205 | if ( $wgUseTeX ) { |
206 | 206 | $binPath = '/usr/bin/'; |
207 | | - $binPathLocal = '/usr/local/bin/'; |
208 | 207 | $swMathName = Array( |
209 | 208 | 'ocaml' => 'OCaml', |
210 | 209 | 'gs' => 'Ghostscript', |
— | — | @@ -233,7 +232,15 @@ |
234 | 233 | 'imagemagick' => '-version', |
235 | 234 | ); |
236 | 235 | foreach ( $swMathExec as $swMath => $swMathCmd ) { |
237 | | - if ( file_exists( $binPath . $swMathCmd ) || file_exists( $binPathLocal . $swMathCmd ) ) { |
| 236 | + $wBinPath = ''; |
| 237 | + if ( file_exists( $binPath . 'whereis' ) ) { |
| 238 | + $swWhereIsInfo = self::execOutput( $binPath . 'whereis -b ' . $swMathCmd ); |
| 239 | + $swWhereIsLine = explode( "\n", $swWhereIsInfo, 2); |
| 240 | + $swWhereIsFirstLine = $swWhereIsLine[0]; |
| 241 | + $swWhereIsBinPath = explode( ' ', $swWhereIsFirstLine, 3); |
| 242 | + $wBinPath = dirname( $swWhereIsBinPath[1] ); |
| 243 | + } |
| 244 | + if ( file_exists( $binPath . $swMathCmd ) || file_exists( $wBinPath . $swMathCmd ) ) { |
238 | 245 | $swMathInfo = self::execOutput( $swMathCmd . ' ' . $swMathParam[$swMath] ); |
239 | 246 | $swMathLine = explode( "\n", $swMathInfo, 2); |
240 | 247 | $swMathVerInfo = $swMathLine[0]; |
— | — | @@ -246,8 +253,8 @@ |
247 | 254 | list( $head, $tail ) = explode( 'ImageMagick', $swMathVerInfo ); |
248 | 255 | list( $swMathVerInfo ) = explode('http://www.imagemagick.org', $tail ); |
249 | 256 | } |
250 | | - $swMathVer[$swMath] = $swMathVerInfo; |
251 | | - $software["[$swMathURL[$swMath] $swMathName[$swMath]]"] = trim ( $swMathVer[$swMath] ); |
| 257 | + $swMathVer[$swMath] = trim( $swMathVerInfo ); |
| 258 | + $software["[$swMathURL[$swMath] $swMathName[$swMath]]"] = $swMathVer[$swMath]; |
252 | 259 | } |
253 | 260 | } |
254 | 261 | } |