From: Kevin Israel Date: Fri, 27 Sep 2013 23:57:41 +0000 (-0400) Subject: Deprecate wfDebugDieBacktrace X-Git-Tag: 1.31.0-rc.0~18662^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=725df97b1b4c156d8a71682cc2145a14cc2ed825;p=lhc%2Fweb%2Fwiklou.git Deprecate wfDebugDieBacktrace Change-Id: I12336983e29524a450fc61ed9df4d840066be9b6 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 414c8222f2..d6e6615380 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1703,10 +1703,12 @@ function wfEmptyMsg( $key ) { * Throw a debugging exception. This function previously once exited the process, * but now throws an exception instead, with similar results. * + * @deprecated since 1.22; just throw an MWException yourself * @param string $msg message shown when dying. * @throws MWException */ function wfDebugDieBacktrace( $msg = '' ) { + wfDeprecated( __FUNCTION__, '1.22' ); throw new MWException( $msg ); } diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 2e6846d508..ce6ecda673 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1503,7 +1503,7 @@ abstract class ApiBase extends ContextSource { * @param string $message Error message */ protected static function dieDebug( $method, $message ) { - wfDebugDieBacktrace( "Internal error in $method: $message" ); + throw new MWException( "Internal error in $method: $message" ); } /** diff --git a/languages/Language.php b/languages/Language.php index f1b7fa64f2..527f382728 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2617,7 +2617,7 @@ class Language { */ function checkTitleEncoding( $s ) { if ( is_array( $s ) ) { - wfDebugDieBacktrace( 'Given array to checkTitleEncoding.' ); + throw new MWException( 'Given array to checkTitleEncoding.' ); } if ( StringUtils::isUtf8( $s ) ) { return $s; diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index 4f6bed5b6a..0b21a1fea5 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -378,7 +378,7 @@ class GenerateSitemap extends Maintenance { function open( $file, $flags ) { $resource = $this->compress ? gzopen( $file, $flags ) : fopen( $file, $flags ); if ( $resource === false ) { - wfDebugDieBacktrace( __METHOD__ . " error opening file $file with flags $flags. Check permissions?" ); + throw new MWException( __METHOD__ . " error opening file $file with flags $flags. Check permissions?" ); } return $resource; } @@ -388,7 +388,7 @@ class GenerateSitemap extends Maintenance { */ function write( &$handle, $str ) { if ( $handle === true || $handle === false ) { - wfDebugDieBacktrace( __METHOD__ . " was passed a boolean as a file handle.\n" ); + throw new MWException( __METHOD__ . " was passed a boolean as a file handle.\n" ); } if ( $this->compress ) { gzwrite( $handle, $str );