r44918 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44917‎ | r44918 | r44919 >
Date:22:56, 22 December 2008
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
Remove unused functions
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -9,7 +9,6 @@
1010 */
1111
1212 require_once dirname(__FILE__) . '/normal/UtfNormalUtil.php';
13 -require_once dirname(__FILE__) . '/XmlFunctions.php';
1413
1514 // Hide compatibility functions from Doxygen
1615 /// @cond
@@ -749,47 +748,7 @@
750749 return $string;
751750 }
752751
753 -
754752 /**
755 - * Just like exit() but makes a note of it.
756 - * Commits open transactions except if the error parameter is set
757 - *
758 - * @deprecated Please return control to the caller or throw an exception
759 - */
760 -function wfAbruptExit( $error = false ){
761 - static $called = false;
762 - if ( $called ){
763 - exit( -1 );
764 - }
765 - $called = true;
766 -
767 - $bt = wfDebugBacktrace();
768 - if( $bt ) {
769 - for($i = 0; $i < count($bt) ; $i++){
770 - $file = isset($bt[$i]['file']) ? $bt[$i]['file'] : "unknown";
771 - $line = isset($bt[$i]['line']) ? $bt[$i]['line'] : "unknown";
772 - wfDebug("WARNING: Abrupt exit in $file at line $line\n");
773 - }
774 - } else {
775 - wfDebug('WARNING: Abrupt exit\n');
776 - }
777 -
778 - wfLogProfilingData();
779 -
780 - if ( !$error ) {
781 - wfGetLB()->closeAll();
782 - }
783 - exit( -1 );
784 -}
785 -
786 -/**
787 - * @deprecated Please return control the caller or throw an exception
788 - */
789 -function wfErrorExit() {
790 - wfAbruptExit( true );
791 -}
792 -
793 -/**
794753 * Print a simple message and die, returning nonzero to the shell if any.
795754 * Plain die() fails to return nonzero to the shell if you pass a string.
796755 * @param string $msg
@@ -837,22 +796,20 @@
838797 return $host;
839798 }
840799
841 - /**
842 - * Returns a HTML comment with the elapsed time since request.
843 - * This method has no side effects.
844 - * @return string
845 - */
846 - function wfReportTime() {
847 - global $wgRequestTime, $wgShowHostnames;
 800+/**
 801+ * Returns a HTML comment with the elapsed time since request.
 802+ * This method has no side effects.
 803+ * @return string
 804+ */
 805+function wfReportTime() {
 806+ global $wgRequestTime, $wgShowHostnames;
 807+ $now = wfTime();
 808+ $elapsed = $now - $wgRequestTime;
 809+ return $wgShowHostnames
 810+ ? sprintf( "<!-- Served by %s in %01.3f secs. -->", wfHostname(), $elapsed )
 811+ : sprintf( "<!-- Served in %01.3f secs. -->", $elapsed );
 812+}
848813
849 - $now = wfTime();
850 - $elapsed = $now - $wgRequestTime;
851 -
852 - return $wgShowHostnames
853 - ? sprintf( "<!-- Served by %s in %01.3f secs. -->", wfHostname(), $elapsed )
854 - : sprintf( "<!-- Served in %01.3f secs. -->", $elapsed );
855 - }
856 -
857814 /**
858815 * Safety wrapper for debug_backtrace().
859816 *
@@ -1208,14 +1165,6 @@
12091166 }
12101167
12111168 /**
1212 - * This is obsolete, use SquidUpdate::purge()
1213 - * @deprecated
1214 - */
1215 -function wfPurgeSquidServers ($urlArr) {
1216 - SquidUpdate::purge( $urlArr );
1217 -}
1218 -
1219 -/**
12201169 * Windows-compatible version of escapeshellarg()
12211170 * Windows doesn't recognise single-quotes in the shell, but the escapeshellarg()
12221171 * function puts single quotes in regardless of OS.
@@ -2395,13 +2344,6 @@
23962345 }
23972346
23982347 /**
2399 - * @deprecated use StringUtils::explodeMarkup
2400 - */
2401 -function wfExplodeMarkup( $separator, $text ) {
2402 - return StringUtils::explodeMarkup( $separator, $text );
2403 -}
2404 -
2405 -/**
24062348 * Convert an arbitrarily-long digit string from one numeric base
24072349 * to another, optionally zero-padding to a minimum column width.
24082350 *
@@ -2515,29 +2457,10 @@
25162458 }
25172459 }
25182460
2519 -/**
2520 - * Alias for modularized function
2521 - * @deprecated Use Http::get() instead
2522 - */
2523 -function wfGetHTTP( $url, $timeout = 'default' ) {
2524 - wfDeprecated(__FUNCTION__);
2525 - return Http::get( $url, $timeout );
2526 -}
2527 -
2528 -/**
2529 - * Alias for modularized function
2530 - * @deprecated Use Http::isLocalURL() instead
2531 - */
2532 -function wfIsLocalURL( $url ) {
2533 - wfDeprecated(__FUNCTION__);
2534 - return Http::isLocalURL( $url );
2535 -}
2536 -
25372461 function wfHttpOnlySafe() {
25382462 global $wgHttpOnlyBlacklist;
25392463 if( !version_compare("5.2", PHP_VERSION, "<") )
25402464 return false;
2541 -
25422465 if( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
25432466 foreach( $wgHttpOnlyBlacklist as $regex ) {
25442467 if( preg_match( $regex, $_SERVER['HTTP_USER_AGENT'] ) ) {
@@ -2545,7 +2468,6 @@
25462469 }
25472470 }
25482471 }
2549 -
25502472 return true;
25512473 }
25522474
@@ -2722,7 +2644,7 @@
27232645 * @return File, or false if the file does not exist
27242646 */
27252647 function wfFindFile( $title, $time = false, $flags = 0, $bypass = false ) {
2726 - if( !$time && !$flags && !$bypass ) {
 2648+ if( !$time && !$flags && !$bypass ) {
27272649 return FileCache::singleton()->findFile( $title );
27282650 } else {
27292651 return RepoGroup::singleton()->findFile( $title, $time, $flags );

Follow-up revisions

RevisionCommit summaryAuthorDate
r44976Revert r44918 "Remove unused functions"...brion21:30, 23 December 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   21:30, 23 December 2008

Reverted in r44976 -- destroys backwards compatibility with any extension code using these functions.

Status & tagging log