r69694 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69693‎ | r69694 | r69695 >
Date:17:24, 21 July 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
@ -> wfSuppressWarnings and wfRestoreWarnings
Modified paths:
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -654,7 +654,11 @@
655655 foreach ( $names as $name ) {
656656 $command = "$path/$name";
657657
658 - if ( @file_exists( $command ) ) {
 658+ wfSuppressWarnings();
 659+ $file_exists = file_exists( $command );
 660+ wfRestoreWarnings();
 661+
 662+ if ( $file_exists ) {
659663 if ( !$versionInfo ) {
660664 return $command;
661665 }
@@ -677,9 +681,15 @@
678682 */
679683 public function envCheckGraphics() {
680684 $imcheck = array( "/usr/bin", "/opt/csw/bin", "/usr/local/bin", "/sw/bin", "/opt/local/bin" );
 685+
681686 foreach( $imcheck as $dir ) {
682687 $im = "$dir/convert";
683 - if( @file_exists( $im ) ) {
 688+
 689+ wfSuppressWarnings();
 690+ $file_exists = file_exists( $im );
 691+ wfRestoreWarnings();
 692+
 693+ if( $file_exists ) {
684694 $this->showMessage( 'config-imagemagick', $im );
685695 $this->setVar( 'wgImageMagickConvertCommand', $im );
686696 return true;

Status & tagging log