* Oracle Schema update to latest
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index b6cabda..b06c1b8 100644 (file)
@@ -1037,7 +1037,7 @@ function wfDebugLog( $logGroup, $text, $public = true ) {
                        wfErrorLog( "$time $host $wiki: $text", $wgDebugLogGroups[$logGroup] );
                }
        } elseif ( $public === true ) {
-               wfDebug( $text, true );
+               wfDebug( "[$logGroup] $text", true );
        }
 }
 
@@ -1242,10 +1242,10 @@ function wfIncrStats( $key, $count = 1 ) {
        $count = intval( $count );
 
        if( $wgStatsMethod == 'udp' ) {
-               global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgDBname, $wgAggregateStatsID;
+               global $wgUDPProfilerHost, $wgUDPProfilerPort, $wgAggregateStatsID;
                static $socket;
 
-               $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : $wgDBname;
+               $id = $wgAggregateStatsID !== false ? $wgAggregateStatsID : wfWikiID();
 
                if ( !$socket ) {
                        $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
@@ -1427,6 +1427,8 @@ function wfMessageFallback( /*...*/ ) {
  * @return String
  */
 function wfMsg( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReal( $key, $args );
@@ -1441,6 +1443,8 @@ function wfMsg( $key ) {
  * @return String
  */
 function wfMsgNoTrans( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReal( $key, $args, true, false, false );
@@ -1472,6 +1476,8 @@ function wfMsgNoTrans( $key ) {
  * @return String
  */
 function wfMsgForContent( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        global $wgForceUIMsgAsContentMsg;
        $args = func_get_args();
        array_shift( $args );
@@ -1493,6 +1499,8 @@ function wfMsgForContent( $key ) {
  * @return String
  */
 function wfMsgForContentNoTrans( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        global $wgForceUIMsgAsContentMsg;
        $args = func_get_args();
        array_shift( $args );
@@ -1518,6 +1526,8 @@ function wfMsgForContentNoTrans( $key ) {
  * @return String: the requested message.
  */
 function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform = true ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        wfProfileIn( __METHOD__ );
        $message = wfMsgGetKey( $key, $useDB, $forContent, $transform );
        $message = wfMsgReplaceArgs( $message, $args );
@@ -1538,6 +1548,8 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform
  * @return string
  */
 function wfMsgGetKey( $key, $useDB = true, $langCode = false, $transform = true ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        wfRunHooks( 'NormalizeMessageKey', array( &$key, &$useDB, &$langCode, &$transform ) );
 
        $cache = MessageCache::singleton();
@@ -1592,6 +1604,8 @@ function wfMsgReplaceArgs( $message, $args ) {
  * @return string
  */
 function wfMsgHtml( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReplaceArgs( htmlspecialchars( wfMsgGetKey( $key ) ), $args );
@@ -1611,6 +1625,8 @@ function wfMsgHtml( $key ) {
  * @return string
  */
 function wfMsgWikiHtml( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        return wfMsgReplaceArgs(
@@ -1642,6 +1658,8 @@ function wfMsgWikiHtml( $key ) {
  * @return String
  */
 function wfMsgExt( $key, $options ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        $args = func_get_args();
        array_shift( $args );
        array_shift( $args );
@@ -1722,6 +1740,8 @@ function wfMsgExt( $key, $options ) {
  * @return Boolean True if the message *doesn't* exist.
  */
 function wfEmptyMsg( $key ) {
+       wfDeprecated( __METHOD__, '1.21' );
+
        return MessageCache::singleton()->get( $key, /*useDB*/true, /*content*/false ) === false;
 }
 
@@ -2340,7 +2360,7 @@ function wfSuppressWarnings( $end = false ) {
                }
        } else {
                if ( !$suppressCount ) {
-                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED ) );
+                       $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT ) );
                }
                ++$suppressCount;
        }
@@ -2916,7 +2936,7 @@ function wfMerge( $old, $mine, $yours, &$result ) {
        fclose( $yourtextFile );
 
        # Check for a conflict
-       $cmd = $wgDiff3 . ' -a --overlap-only ' .
+       $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a --overlap-only ' .
                wfEscapeShellArg( $mytextName ) . ' ' .
                wfEscapeShellArg( $oldtextName ) . ' ' .
                wfEscapeShellArg( $yourtextName );
@@ -2930,7 +2950,7 @@ function wfMerge( $old, $mine, $yours, &$result ) {
        pclose( $handle );
 
        # Merge differences
-       $cmd = $wgDiff3 . ' -a -e --merge ' .
+       $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a -e --merge ' .
                wfEscapeShellArg( $mytextName, $oldtextName, $yourtextName );
        $handle = popen( $cmd, 'r' );
        $result = '';
@@ -3180,7 +3200,7 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = t
                $input == '' ) {
                return false;
        }
-       $digitChars = ( $lowercase ) ? '0123456789abcdefghijklmnopqrstuvwxyz' : '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+       $digitChars = '0123456789abcdefghijklmnopqrstuvwxyz';
        $inDigits = array();
        $outChars = '';
 
@@ -3236,6 +3256,10 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, $lowercase = t
                $outChars .= '0';
        }
 
+       if ( !$lowercase ) {
+               $outChars = strtoupper( $outChars );
+       }
+
        return strrev( $outChars );
 }