@ -> wfSuppressWarnings and wfRestoreWarnings
authorJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Wed, 21 Jul 2010 17:24:39 +0000 (17:24 +0000)
committerJeroen De Dauw <jeroendedauw@users.mediawiki.org>
Wed, 21 Jul 2010 17:24:39 +0000 (17:24 +0000)
includes/installer/Installer.php

index b609ce8..b4cfe4a 100644 (file)
@@ -654,7 +654,11 @@ abstract class Installer {
                foreach ( $names as $name ) {
                        $command = "$path/$name";
                        
-                       if ( @file_exists( $command ) ) {
+                       wfSuppressWarnings();
+                       $file_exists = file_exists( $command );
+                       wfRestoreWarnings();
+                       
+                       if ( $file_exists ) {
                                if ( !$versionInfo ) {
                                        return $command;
                                }
@@ -677,9 +681,15 @@ abstract class Installer {
         */
        public function envCheckGraphics() {
                $imcheck = array( "/usr/bin", "/opt/csw/bin", "/usr/local/bin", "/sw/bin", "/opt/local/bin" );
+               
                foreach( $imcheck as $dir ) {
                        $im = "$dir/convert";
-                       if( @file_exists( $im ) ) {
+                       
+                       wfSuppressWarnings();
+                       $file_exists = file_exists( $im );
+                       wfRestoreWarnings();                    
+                       
+                       if( $file_exists ) {
                                $this->showMessage( 'config-imagemagick', $im );
                                $this->setVar( 'wgImageMagickConvertCommand', $im );
                                return true;