Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -9,7 +9,6 @@ |
10 | 10 | */ |
11 | 11 | |
12 | 12 | require_once dirname(__FILE__) . '/normal/UtfNormalUtil.php'; |
13 | | -require_once dirname(__FILE__) . '/XmlFunctions.php'; |
14 | 13 | |
15 | 14 | // Hide compatibility functions from Doxygen |
16 | 15 | /// @cond |
— | — | @@ -749,47 +748,7 @@ |
750 | 749 | return $string; |
751 | 750 | } |
752 | 751 | |
753 | | - |
754 | 752 | /** |
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 | | -/** |
794 | 753 | * Print a simple message and die, returning nonzero to the shell if any. |
795 | 754 | * Plain die() fails to return nonzero to the shell if you pass a string. |
796 | 755 | * @param string $msg |
— | — | @@ -837,22 +796,20 @@ |
838 | 797 | return $host; |
839 | 798 | } |
840 | 799 | |
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 | +} |
848 | 813 | |
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 | | - |
857 | 814 | /** |
858 | 815 | * Safety wrapper for debug_backtrace(). |
859 | 816 | * |
— | — | @@ -1208,14 +1165,6 @@ |
1209 | 1166 | } |
1210 | 1167 | |
1211 | 1168 | /** |
1212 | | - * This is obsolete, use SquidUpdate::purge() |
1213 | | - * @deprecated |
1214 | | - */ |
1215 | | -function wfPurgeSquidServers ($urlArr) { |
1216 | | - SquidUpdate::purge( $urlArr ); |
1217 | | -} |
1218 | | - |
1219 | | -/** |
1220 | 1169 | * Windows-compatible version of escapeshellarg() |
1221 | 1170 | * Windows doesn't recognise single-quotes in the shell, but the escapeshellarg() |
1222 | 1171 | * function puts single quotes in regardless of OS. |
— | — | @@ -2395,13 +2344,6 @@ |
2396 | 2345 | } |
2397 | 2346 | |
2398 | 2347 | /** |
2399 | | - * @deprecated use StringUtils::explodeMarkup |
2400 | | - */ |
2401 | | -function wfExplodeMarkup( $separator, $text ) { |
2402 | | - return StringUtils::explodeMarkup( $separator, $text ); |
2403 | | -} |
2404 | | - |
2405 | | -/** |
2406 | 2348 | * Convert an arbitrarily-long digit string from one numeric base |
2407 | 2349 | * to another, optionally zero-padding to a minimum column width. |
2408 | 2350 | * |
— | — | @@ -2515,29 +2457,10 @@ |
2516 | 2458 | } |
2517 | 2459 | } |
2518 | 2460 | |
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 | | - |
2537 | 2461 | function wfHttpOnlySafe() { |
2538 | 2462 | global $wgHttpOnlyBlacklist; |
2539 | 2463 | if( !version_compare("5.2", PHP_VERSION, "<") ) |
2540 | 2464 | return false; |
2541 | | - |
2542 | 2465 | if( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { |
2543 | 2466 | foreach( $wgHttpOnlyBlacklist as $regex ) { |
2544 | 2467 | if( preg_match( $regex, $_SERVER['HTTP_USER_AGENT'] ) ) { |
— | — | @@ -2545,7 +2468,6 @@ |
2546 | 2469 | } |
2547 | 2470 | } |
2548 | 2471 | } |
2549 | | - |
2550 | 2472 | return true; |
2551 | 2473 | } |
2552 | 2474 | |
— | — | @@ -2722,7 +2644,7 @@ |
2723 | 2645 | * @return File, or false if the file does not exist |
2724 | 2646 | */ |
2725 | 2647 | function wfFindFile( $title, $time = false, $flags = 0, $bypass = false ) { |
2726 | | - if( !$time && !$flags && !$bypass ) { |
| 2648 | + if( !$time && !$flags && !$bypass ) { |
2727 | 2649 | return FileCache::singleton()->findFile( $title ); |
2728 | 2650 | } else { |
2729 | 2651 | return RepoGroup::singleton()->findFile( $title, $time, $flags ); |