From c8cbff08d8f146e5ebeb6fdee3b48c567c8e2e06 Mon Sep 17 00:00:00 2001 From: lwelling Date: Mon, 10 Dec 2012 13:40:01 -0500 Subject: [PATCH] Remove fallback for PHP installs < v5.3.2 as that is now an install requirement The native stream_resolve_include_path can now be used exclusively Change-Id: I891fe9e08f5257614dbc966e725c9810423108a5 --- includes/Fallback.php | 18 ------------------ includes/UserMailer.php | 7 +------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/includes/Fallback.php b/includes/Fallback.php index 4b138c11a3..b51765682d 100644 --- a/includes/Fallback.php +++ b/includes/Fallback.php @@ -192,22 +192,4 @@ class Fallback { return false; } } - - /** - * Fallback implementation of stream_resolve_include_path() - * Native stream_resolve_include_path is available for PHP 5 >= 5.3.2 - * @param $filename String - * @return String - */ - public static function stream_resolve_include_path( $filename ) { - $pathArray = explode( PATH_SEPARATOR, get_include_path() ); - foreach ( $pathArray as $path ) { - $fullFilename = $path . DIRECTORY_SEPARATOR . $filename; - if ( file_exists( $fullFilename ) ) { - return $fullFilename; - } - } - return false; - } - } diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 66c70b364e..b8b6aa86a0 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -231,12 +231,7 @@ class UserMailer { # PEAR MAILER # - if ( function_exists( 'stream_resolve_include_path' ) ) { - $found = stream_resolve_include_path( 'Mail.php' ); - } else { - $found = Fallback::stream_resolve_include_path( 'Mail.php' ); - } - if ( !$found ) { + if ( ! stream_resolve_include_path( 'Mail.php' ) ) { throw new MWException( 'PEAR mail package is not installed' ); } require_once( 'Mail.php' ); -- 2.20.1