ImageMagick check now notes that only directories in the PATH are checked.
authorDan Fuhry <dan@enanocms.org>
Mon, 15 Nov 2010 16:58:05 -0500
changeset 1310 41ac3758ba79
parent 1309 2a14b5a25338
child 1311 a228f7e8fb15
ImageMagick check now notes that only directories in the PATH are checked.
includes/functions.php
install/includes/stages/sysreqs.php
language/english/install.json
--- a/includes/functions.php	Thu Oct 28 03:32:57 2010 -0400
+++ b/includes/functions.php	Mon Nov 15 16:58:05 2010 -0500
@@ -5274,6 +5274,21 @@
 }
 
 /**
+ * Return the OS's PATH variable.
+ * @return string
+ */
+
+function get_system_path()
+{
+	$path = ( isset($_ENV['PATH']) ) ? $_ENV['PATH'] : ( isset($_SERVER['PATH']) ? $_SERVER['PATH'] : false );
+	if ( !$path )
+		// couldn't get OS's PATH
+		return false;
+		
+	return $path;
+}
+
+/**
  * Implementation of the "which" command in native PHP.
  * @param string command
  * @return string path to executable, or false on failure
@@ -5281,15 +5296,15 @@
 
 function which($executable)
 {
-	$path = ( isset($_ENV['PATH']) ) ? $_ENV['PATH'] : ( isset($_SERVER['PATH']) ? $_SERVER['PATH'] : false );
-	if ( !$path )
-		// couldn't get OS's PATH
+	$path = get_system_path();
+	if ( empty($paths) )
 		return false;
-		
+	
 	$win32 = ( PHP_OS == 'WINNT' || PHP_OS == 'WIN32' );
 	$extensions = $win32 ? array('.exe', '.com', '.bat') : array('');
 	$separator = $win32 ? ';' : ':';
 	$paths = explode($separator, $path);
+	
 	foreach ( $paths as $dir )
 	{
 		foreach ( $extensions as $ext )
--- a/install/includes/stages/sysreqs.php	Thu Oct 28 03:32:57 2010 -0400
+++ b/install/includes/stages/sysreqs.php	Mon Nov 15 16:58:05 2010 -0500
@@ -127,7 +127,7 @@
 // FS test: ImageMagick
 $req_imagick = which('convert');
 if ( !$req_imagick )
-	$warnings[] = $lang->get('sysreqs_req_help_imagemagick');
+	$warnings[] = $lang->get('sysreqs_req_help_imagemagick', array('path' => get_system_path()));
 
 $crypto_backend = install_get_crypto_backend();
 
--- a/language/english/install.json	Thu Oct 28 03:32:57 2010 -0400
+++ b/language/english/install.json	Mon Nov 15 16:58:05 2010 -0500
@@ -110,7 +110,7 @@
 			req_help_uploads: 'PHP file upload support is a prerequisite for uploading files via Enano\'s web interface.',
 			req_help_writable: 'Certain files need to be writable for installation and certain features to work properly. Use your FTP client\'s "CHMOD" feature to set numeric permissions on the items listed above: 666 for files, and 777 for directories. It\'s safest to CHMOD config.php to 444 once installation is complete.',
 			req_help_gd2: 'Without GD, Enano has to use a visual confirmation engine that generates weaker images that are easier to break.',
-			req_help_imagemagick: 'Without ImageMagick, Enano will use GD (if it is available) to scale images down. This is slightly slower.',
+			req_help_imagemagick: 'Without ImageMagick, Enano will use GD (if it is available) to scale images down. This is slightly slower. Note that the installer only checked your server\'s PATH environment variable (reported as: %path%); it is possible that ImageMagick is installed in another location. Check your web host\'s documentation to find out if ImageMagick is installed.',
 			req_help_crypto_none: 'Your server has no support for arbitrary-precision math, which is required for encrypted logon. Your username and password will not be transmitted securely until one of the following PHP extensions is installed: GMP, Big_Int, or BCMath.',
 			req_help_crypto_bcmath: 'Your server supports arbitrary-precision math, but only through PHP\'s BCMath extension which is extremely slow. Expect the process of logging in to take 6-10 seconds.',