From ffad65b6bc701729dc46be2247fc091d2f0aa85c Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 17 Dec 2010 15:40:08 +0000 Subject: [PATCH] Installer can handle exceptions now, also suppress possible permission errors with fopen() --- includes/db/Database.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/db/Database.php b/includes/db/Database.php index 6aaa7aed43..5b6254a7ec 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2398,13 +2398,12 @@ abstract class DatabaseBase implements DatabaseType { * using $filename */ function sourceFile( $filename, $lineCallback = false, $resultCallback = false, $fname = false ) { + wfSuppressWarnings(); $fp = fopen( $filename, 'r' ); + wfRestoreWarnings(); if ( false === $fp ) { - if ( !defined( "MEDIAWIKI_INSTALL" ) ) - throw new MWException( "Could not open \"{$filename}\".\n" ); - else - return "Could not open \"{$filename}\".\n"; + throw new MWException( "Could not open \"{$filename}\".\n" ); } if ( !$fname ) { -- 2.20.1