From: Max Semenik Date: Mon, 18 Oct 2010 16:21:31 +0000 (+0000) Subject: Fixed ImageMagick detection on Windows X-Git-Tag: 1.31.0-rc.0~34446 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=b7578deb8b05276ce6445969e1e0efa2882cc865;p=lhc%2Fweb%2Fwiklou.git Fixed ImageMagick detection on Windows --- 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;