From b7578deb8b05276ce6445969e1e0efa2882cc865 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Mon, 18 Oct 2010 16:21:31 +0000 Subject: [PATCH] Fixed ImageMagick detection on Windows --- includes/installer/Installer.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 88b8316e50..0365ec13a6 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -609,8 +609,8 @@ abstract class Installer { * Environment check for ImageMagick and GD. */ public function envCheckGraphics() { - $names = array( 'convert', 'convert.exe' ); - $convert = $this->locateExecutableInDefaultPaths( $names ); + $names = array( wfIsWindows() ? 'convert.exe' : 'convert' ); + $convert = $this->locateExecutableInDefaultPaths( $names, array( '$1 -version', 'ImageMagick' ) ); if ( $convert ) { $this->setVar( 'wgImageMagickConvertCommand', $convert ); @@ -888,7 +888,7 @@ abstract class Installer { } foreach ( $names as $name ) { - $command = "$path/$name"; + $command = $path . DIRECTORY_SEPARATOR . $name; wfSuppressWarnings(); $file_exists = file_exists( $command ); @@ -899,6 +899,9 @@ abstract class Installer { return $command; } + if ( wfIsWindows() ) { + $command = "\"$command\""; + } $file = str_replace( '$1', $command, $versionInfo[0] ); if ( strstr( wfShellExec( $file ), $versionInfo[1]) !== false ) { return $command; -- 2.20.1